-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
How to use this library when you have multiple push providers? #952
Comments
@shercoder have you figured this out? |
@gorjuspixels Yeah I ended up forking this repo and fixing it in a feature branch. I haven't had a chance to make a PR for this repo. I'll see if I can do that this weekend but here is the draft PR if you need example buildcom#1 |
Then In your custom FirebaseMessagingService, you can do something like this: private RNReceivedMessageHandler receivedMessageHandler = new RNReceivedMessageHandler(this);
...
...
...
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
Map<String, String> data = remoteMessage.getData();
String from = remoteMessage.getFrom();
try {
if (from first provider) {
receivedMessageHandler.handleReceivedMessage(remoteMessage);
} else {
// pass remote message to another provider
}
} catch (Exception e) {
Log.e(e, "Failed to extract Push Message", remoteMessage.getMessageId());
}
} |
@gorjuspixels Sorry for taking so long to get this in but if you're still looking for the solution, I have finally found some time to get the PR rolling to support this here #1128 Even if this is no longer your requirement, I would really love it if you can test the PR for me. 🙏 Again, apologies for the delay. |
@shercoder Can you please help me here If I want to pass |
@uraniumreza I do not use RNFirebase, so I am not familiar with their API. I'd suggest reading through their docs and if you can't find your answer then create an issue on their Github repo. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
I'm using react-native-push-notification along with Localytics push messaging. So I created a custom FirebaseMessagingService that checks if RemoteMessage is a Localytics message else it needs to fire
RNPushListenerService
.I'm starting RNPushListenerService using startService but it does not look like it is starting it. Has anyone else dealt with issue like this before? and How did you handle it?
Note: There can only be one FirebaseMessagingService with intent-filter of
com.google.firebase.MESSAGING_EVENT
and I'm registering my custom service with that intent-filter.I think react-native-push-notification library needs to provide a custom method like the one Localytics is providing to handle these notifications when the user has multiple push providers. e.g.
Localytics.handleFirebaseMessage
The text was updated successfully, but these errors were encountered: