We have developed a React Native mobile app. For multiple updates in Salesforce, we are sending push notifications on this mobile app from apex with the help of standard "PushNotification" class methods as mentioned in below official link:- https://developer.salesforce.com/docs/atlas.en-us.232.0.pushImplGuide.meta/pushImplGuide/pns_apex_trigger.htm

Now these notifications are working fine on iOS, but they are not delivered on Android device and even logs were not generated on the firebase console. In salesforce debug logs, we got PUSH_NOTIFICATION_SENT successfully.

We tried sending push notifications from the third party then logs were generated on the firebase console and notifications were delivered to the android device.

After trying multiple ways on salesforce, we directly called the FCM endpoint (https://fcm.googleapis.com/fcm/send) from the apex. We have hardcoded device token generated on salesforce in the body of the request and we have successfully received notifications on android devices and even logs generated on the firebase.

So coming back to the original question, has anyone got push notifications delivered on Android devices in React Native app by using standard "PushNotification" class methods? If yes, please let me know any missing steps on salesforce or android.

Alternatively, is there a way to get/query device tokens dynamically in apex based on user? As we cannot hard code device tokens for real implementation.

Also, we are using Salesforce mobile SDK for React-Native version 8.20, let us know if you have encountered any issues with it.

  • We have lots of RN customers using and successfully receiving push notifications. In fact, there are almost 2 billion installations of our SDK across native, frameworks, et al. Open a support case. You probably have an implementation issue with your application.
    – Bill Mote
    Sep 14 '21 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.