Open Maharshi01 opened 3 years ago
Hi, @Maharshi01 We have 2 options for this issue. The first one is in this class to extend our service (We must change it in modules or fork project and republish it...)https://github.com/invertase/react-native-firebase/blob/master/packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingService.java ...
The second one is I can emit all these events from our SDK but only in case if you use Firebase only for android or you can remove the RN Firebase part for android and keep it for iOS .
There is also the possibility to make functions that forward PushMessage and Token from Firebase RN SDK to OUR but it will take much more time
What do you think? Is this first option ok for you?
Hi @acamarinkovic
I think the first option looks okay to me 'cause we cannot go with second approach as UMobile application uses firebase services for both android and ios
Hi @Maharshi01,
I'm fork project and make changes to what you should do on your module https://github.com/acamarinkovic/react-native-firebase/commit/c533db11101e1ab40132e6a29f26137f3e08e53b .
I don't know if it will have any side effects on your application. If it is, we will adjust the solution.
Okay @acamarinkovic , Did you merge it and publish it ? I hope that there shouldn't be any : )
Please find the firebase functions that we are using for notification listening :
// To listen to messages in the foreground, call the onMessage this.removeMessageListener = messaging().onMessage(async notification => { try { NavigationService.getNavigator().props.screenProps.globalEvents.emit('notification', true); LogTracker.debug("Messaging Service - FCM: onMessage", notification); } catch (error) { LogTracker.debug("Messaging Service - FCM: onMessage Error", error); }