Reputation: 419
I'm trying to create a messenger app with React Native and firebase for iOS, but I'm unsure of what route to take in order to enable remote push notifications every time a message is received. Every route I've looked at seems to require xCode to configure capabilities or requires me to edit a AppDelegate.m file, however I am developing on a PC so I'm not able to use xcode. I test the iOS app using expo and a physical iPhone. Is there any way to enable push notifications for my create-react-native iOS app under my specific circumstances of using a pc for development and firebase for my backend?
Upvotes: 3
Views: 4146
Reputation: 1
Is your app detached/ejected?
An undetached EXPO project doesn't support adding native libraries so the only way you can do push notifications is through the Expo push notification system. You may be able to get your firebase API to push data to a remote url using a webhook - in that case you can simply push a message to Expo's push notification endpoint once a user has completed an action, but you will need to find a way to store and retrieve their expo push notification token.
https://docs.expo.io/versions/latest/guides/push-notifications is the documentation for push notifications and https://exp.host/--/api/v2/push/send
is the endpoint to hit to send a push notification.
There are some SAAS products out there that allow you to remote into a mac which you could try to use to setup your detached xcode project and then build using Microsoft App Center or something similar from that point on but the complexity increases.
Upvotes: 3