We are moving to Discord!

Join us on the Countly Community Discord Server! Engage in discussions, share your feature ideas, and learn from fellow Countly users to build exceptional apps and experiences.

[React-native] Push notification issue

I want using push notification in react-native.
And i follow https://support.count.ly/hc/en-us/articles/360037813231-React-Native-Bridge-#general-setup
And when using Countly.askForNotificationPermission(); I have issue 


And more issue. In dashboard -> messaging, I can see I have 6 user can receive notification but when i create one-time notification i can't send it, it error Sorry, there are no push-enabled users for specified options.

thanks.

0

Comments

9 comments
  • Official comment

    Hi José, Thanks for reporting this issue!

    So, this issue happens If firebase-messaging is resolved to v22 due to any reason.

    These could be the multiple reasons that your project is using firebase-messaging v22; some of them are:
    — You or some plugin you have added is using firebase-bom with V28+
    — Some plugin is directly using firebase-messaging v22
    — You have manually edit the firebase-messaging to v22

    Our engineering team is are already working on it and we will release a proper fix in the next release.

    For now, as a workaround, you can add the 'com.google.firebase:firebase-iid' to your Android/app/build.gradle. It should work as expected.

    Additionally,


    If you go to your Dashboard and open your Messaging page, you'll see that the MESSAGING-ENABLED USERS is showing the count of both production and test users for both platforms (iOS/Android).

    For e.g.: You have selected Platform “Android” and “Production Users”, if no user is available with these options, then you will get this message “Sorry, there are no push-enabled users for specified options.
    Try to change platforms or production-test switch."

     

    Please let me know if you have any questions about this.

    Comment actions Permalink
  • Hi @Kenvin Alves
    I've try with suggestion of you, and I can run my app, but when I push notification from dashboard Countly, I receive error Background messages only work if the message priority is set to 'high' (Android)

    Currently, My app is still receiving notifications from fcm.
    You can add field "priority": "high" when send notification?.
    thanks.

    0
    Comment actions Permalink
  • Hello, what device are you testing this on?

    0
    Comment actions Permalink
  • Hi Arturs Kadikis
    I'm testing on Xiaomi redmi note 7.

    0
    Comment actions Permalink
  • Hi Jose,

    Would you please share some more details about how and which dependencies/plugins are you importing for push notifications?
    If you can share your package.json file that would be more helpful.

    0
    Comment actions Permalink
  • Hi Muhammad Junaid Akram
    This is my file package.json

    {
    "name": "MyApp",
    "version": "0.0.1",
    "private": true,
    "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint .",
    "lint:fix": "eslint --fix .",
    "postinstall": "patch-package"
    },
    "dependencies": {
    "@fawazahmed/react-native-read-more": "^2.1.1",
    "@honeybadger-io/react-native": "^0.0.7",
    "@react-native-community/async-storage": "^1.12.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/push-notification-ios": "^1.8.0",
    "@react-native-community/slider": "^4.1.6",
    "@react-native-community/toolbar-android": "^0.1.0-rc.2",
    "@react-native-firebase/app": "^12.1.0",
    "@react-native-firebase/messaging": "^12.1.0",
    "@react-native-picker/picker": "^1.16.7",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/core": "^5.15.3",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "axios": "^0.21.1",
    "countly-sdk-react-native-bridge": "^20.11.8",
    "lodash": "^4.17.21",
    "patch-package": "^6.4.7",
    "react": "17.0.1",
    "react-audio-player": "^0.17.0",
    "react-native": "0.64.1",
    "react-native-background-timer": "^2.4.1",
    "react-native-blob-util": "^0.13.11",
    "react-native-config": "^1.4.2",
    "react-native-controlled-mentions": "^2.2.5",
    "react-native-create-thumbnail": "^1.4.1",
    "react-native-document-picker": "6.0.4",
    "react-native-dropdown-picker": "^5.1.19",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-image-crop-picker": "^0.36.2",
    "react-native-image-header-scroll-view": "^1.0.0",
    "react-native-image-picker": "^4.0.6",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal": "^11.10.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-push-notification": "^7.4.0",
    "react-native-reanimated": "^2.1.0",
    "react-native-responsive-fontsize": "^0.5.0",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.2.0",
    "react-native-slider": "^0.11.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "^12.1.1",
    "react-native-switch-selector": "^2.1.4",
    "react-native-thumbnail-video": "^0.1.2",
    "react-native-track-player": "2.1.0",
    "react-native-url-preview": "^1.1.9",
    "react-native-user-avatar-component": "^0.0.4",
    "react-native-vector-icons": "^8.1.0",
    "react-native-video": "^5.1.1",
    "react-native-video-player": "^0.10.1",
    "react-native-webview": "^11.6.4",
    "react-redux": "^7.2.4",
    "redux": "^4.1.0",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "validator": "^13.6.0"
    },
    "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "eslint-config-airbnb-base": "^14.2.1",
    "eslint-plugin-import": "^2.23.2",
    "eslint-plugin-react": "^7.23.2",
    "eslint-plugin-react-native": "^3.10.0",
    "husky": "^6.0.0",
    "jest": "^26.6.3",
    "lint-staged": "^11.0.0",
    "metro-react-native-babel-preset": "^0.64.0",
    "react-native-svg-transformer": "^0.14.3",
    "react-test-renderer": "17.0.1"
    },
    "jest": {
    "preset": "react-native"
    }
    }


    And I can receive notification from my server. but when push notification from Countly dashboard, I see error  Background messages only work if the message priority is set to 'high'.

    Thanks.
    0
    Comment actions Permalink
  • Hi Jose,

    You are using some other plugins/libraries for push notifications that could cause conflicts with Countly SDK push notifications. We recommended not use any additional FCM libraries with Countly SDK for push notifications.
    Could you remove those additional libraries and see if that fixes your issue?

    Thanks,

    0
    Comment actions Permalink
  • Hi Muhammad Junaid Akram

    I think I can't do it. Because, in my app, I've some difference service push notification, And currently, it work well, And when I add more countly sdk, I just have issue in android, iOS work well.
    You can check again data when send notification for android and add priority = high?.

    {
        "android": {
            "priority": "high"
        }
    }

    Thanks.

    0
    Comment actions Permalink
  • Hello, previously you said that "I can receive notification from my server", could you expand on that? What specifically do you use and how are you sending them? With what kind of priority are you sending those push messages?

    Could you for the sake of the experiment try receiving a countly push message only with the required permissions for it? Maybe even a new app which doesn't include any additional push services or libraries. Our current testing indicates that in that case the error message wouldn't show up.

    0
    Comment actions Permalink

Please sign in to leave a comment.