Pushwoosh / pushwoosh-react-native-plugin

Other
57 stars 43 forks source link

Is not compatible with react-native-firebase/messaging #132

Closed lundjrl closed 2 years ago

lundjrl commented 2 years ago

Hey all,

I've spent a few hours trying to figure out why my devices won't get a push notification and it was due to react-native-firebase/messaging being installed in the project as well. I didn't call any functions from it but by it just being in a node_module, it caused things to not work as expected.

In the Pushwoosh console, I would keep getting error messages saying "mismatch senderID" which is a Firebase error message but this was the root cause for my scenario.

Could we update the documentation/readme to have this notice?

wfhm commented 2 years ago

@lundjrl

Most probably, the conflict is caused by both plugins adding their own FirebaseMessagingService implementations. Both of the services are declared in the app's AndroidManifest.xml with the same android:priority parameter, but only the first one declared (the one that is put higher than the other one in the final generated AndroidManifest.xml) will be used. As payloads sent by Firebase and Pushwoosh backends are different, pushes will not be correctly handled by our SDK if they are received by the Firebase plugin's service. To resolve this issue, you will need to manually add your own FirebaseMessagingService implementation that will route all received pushes between the plugins' services. You can find the guide on how to do it by the link below:

https://docs.pushwoosh.com/platform-docs/pushwoosh-sdk/android-push-notifications/customizing-android-sdk/android-faq#using-pushwoosh-sdk-with-other-fcm-services

As for the MismatchSenderID errors in the Control Panel, they usually appear when the credentials you specified in the Application Configuration in the Control Panel do not match the Sender ID you put in the init() method in your app. To resolve this issue we have to know your Pushwoosh App ID, so, to not expose this data publicly, I suggest creating a support ticket at our Help Center, our Support team will be happy to assist you with it.

lundjrl commented 2 years ago

Hey there, I was totally fine with removing the react-native-firebase/messaging package from my project but just thought we could put a notice in the readme or something so others don't make this same mistake.

wfhm commented 2 years ago

@lundjrl Thanks for the suggestion! I've created a task for our tech writer to update the docs with such a hint.