-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Enables the ability to support multiple push providers #1128
Conversation
Exposing handling of received messages without starting the service when you have a custom firebase service that handles multiple push providers
The fallback variables defined in the build gradle are all undefined DEFAULT_SUPPORT_LIB_VERSION DEFAULT_GOOGLE_PLAY_SERVICES_VERSION DEFAULT_FIREBASE_MESSAGING_VERSION (cherry picked from commit fe1da09)
This would also let us localise the messages from the push notification (if anyone know a work around for this, please let me know) |
@zo0r have you seen this PR? Supporting multiple push providers from the npm package would be great 🙂 |
* upstream/master: Update package.json Fix undefined fallback variables in build gradle Update README.md Update package.json Update README.md Update PushNotificationIOS dependency Update react-native.config.js
Updating our forked version to 4.0.0 so we don't get confused with the version on the original repo
@Dallas62 it seems like you have been driving the repo forward lately so just wanted to be sure you saw this PR. This functionality would be amazing to have for a number of different projects. |
I will take a look ASAP 😉 |
Awesome! Much appreciated, and also a big thank you to @shercoder for the PR! |
Thank you @mysport12 and @Dallas62. This would be a great addition to the lib, one of my former colleague ran into the same problem and I had to point him to my forked branch for the time being. |
Hi @shercoder |
@Dallas62 I'm not 100% but I'll see if I can carve some time this weekend. Also, I haven't looked at changes in 0.62 (latest), are there any changes I should be aware of? |
Hi! I needed to use this library with another push provider on a project I am currently working on, so took a stab at reimplementing @shercoder 's pr back on current dev. Am submitting it back to library in case it is helpful! Here is the pr #1445 |
Hi, |
This change only impacts Android
The need for this change came because the project I work has a need to support multiple push providers. We have an internal provider where we manager our in-house push notifications and then there is a need for external/marketing push notifications that we depend on a third-party to deliver.
Since there can only be one FirebaseMessagingService with intent-filter of com.google.firebase.MESSAGING_EVENT, we cannot have a service from Localytics and RNPushNotificationListenerService declared in our AndroidManifest. Android by default will only pick the first declaration.
In order to support multiple providers, a developer can create a custom FirebaseMessagingService that distributes the push notification to providers. Please see this issue I created that explains the problem and the solution in more details #952
Basically this change now allows the developer in need to do the following in their custom FirebaseMessagingService:
NOTE: There will be no change in behavior in how the current version of this library works and the users who don't need the support for multiple push providers won't have to change anything in their code base and continue to use the
RNPushNotificationListenerService
as it is.Testing
FirebaseMessagingService
instead ofRNPushNotificationListenerService
as mentioned above.