Hi
I have a react native app that uses this library for implementing remote push notifications.
For the android version I use FCM as my notification provider. The default notification provider for iOS apps is APN. I've been wondering if it's possible to configure the iOS app in such that the same code (like onRegister, onNotification) will work on iOS as well, or for FCM to work with iOS I can't use this library and must use some other react-native packages to communicate with the FCM servers.
(I searched and found many tutorials on how to use FCM with iOS apps, but all of them used react-native-firebase for implementing remote push notifications).
In case it's possible to use this package for implementing remote push notifications on iOS, if someone can provide a code example with the required configuration of the iOS project, it will be great!
Thanks!
Hi @Pazamozaurus
Please refer to this documentation:
https://firebase.google.com/docs/cloud-messaging/ios/certs?hl=fr
You can't use something else than APN, but firebase can use APN to unify the service.
@Dallas62
Thanks for the fast response!
Yeah, I saw that documentation. My question is about the client-side code.
Assuming I do the required configuration on the server side, does the same code for handling notifications will work (onRegister, onNotification), or I also must use additional react-native packages?
According to this link
https://firebase.google.com/docs/cloud-messaging/ios/first-message?hl=fr
It seems I have to add some code in order for my app to be able to communicate with FireBase. But then it also delves into implementing push notifications natively(in swift/objective C), and I'm not really sure what parts I need to do on my own and what parts using the react-native-push-notification covers for me.
the same problem has been stuck with it for 2 days now, any solutions??
Hi,
This library doesn鈥檛 implement iOS specific code,
For firebase on iOS you can try with rn-firebase/messaging
Hi guys, did you find any solution yet? I'm stuck with the same problem and the below issue explains what I tried so far:
How to subscribe to remote notifications from FCM?
I think, you must use react-native-firebase to receive the FCM token (the messaging().getToken method), but I'm still trying to figure out, how to get onNotification to be called for remote notifications on iOS.
Hi,
If you are using firebase for both iOS and Android, I can suggest you to use @react-native-firebase/messaging for all remote messages. In complement, this library can handle local notifications.
Hi,
If you are using firebase for both iOS and Android, I can suggest you to use@react-native-firebase/messagingfor all remote messages. In complement, this library can handle local notifications.
thanks! This worked for me until we moved scheduled (lokal) notifications serverside
Most helpful comment
Hi,
If you are using firebase for both iOS and Android, I can suggest you to use
@react-native-firebase/messagingfor all remote messages. In complement, this library can handle local notifications.