How to use APN and GCM on react-native?
Is there any plugin like phonegap-plugin-push on Apache Cordova?
Related
I have 2 apps and I implemented expo push notification and everything was fine, but in the other one it asked me for the experienceid as a prop to Notifications.getExpoPushTokenAsync({
experienceId: "#name/slug,
});
and when trying to send a notification it gives me this error: InvalidCredentials: Unable to retrieve the FCM server key for the recipient's app. Make sure you have provided a server key as directed by the Expo FCM documentation.
I dont want to use FCM, i want to use expo push api.
Can you help me?
The Expo Push API uses FCM for Android, and while it's not necessary to configure it for Expo Go (this is done already for the Expo Go app), when you deploy your standalone app you will need to have it configured for FCM. More information here: https://docs.expo.dev/push-notifications/using-fcm/
I had expo sdk less than sdk 45 in my expo react native app which previously used expo cli. For using FCM, I used to write expo push:android:upload --api-key , in which your token means server key. But now, my app has been converted to eas cli and I can't find the command or procedure to use FCM for notifications in my app anywhere not even in expo documentation. I previously used to follow this guide
enter link description here
Run eas credentials, select Android, then Push Notifications: Manage your FCM Api Key, and then choose the appropriate option to set up the key.
docs...
OR
Go to https://expo.dev/
Select a project
Go to credentials
Click on the application ID
In the Service Credentials section, add FCM Server Key
how can I integrate push notifications with React Native + Expo + Back4app
Back4App has it own push notification system but its not recommended to use it for expo because there are additional configurations you need to work on. read https://docs.expo.dev/introduction/why-not-expo/ for more details.
However, it is quite easy to trigger push notifications in Expo. https://docs.expo.dev/push-notifications/sending-notifications/ . If you look at the diagram here, you can have a cloud code setup that will do a post request to the Expo backend to trigger the push notification.
I am building a React Native(Expo) app that can send notifications to another app(not built with react-native). I have the FCM token(device-token) of the target app. How can I send notifications to that app using firebase cloud messaging(FCM)?
The target app is NOT built using react-native and has everything handled for the incoming notification. I just need to send the notification to the target app. Thank you in advance.
I searched some notification library for react-native.
https://github.com/zo0r/react-native-push-notification
This works well for Android but it requires Apns for ios
I would like to find some libraries that doen not require Apns and simple.
There is no avoiding using APNS for remote push notifications.
In order to receive data in certain scenarios, such as having your app running in the background, phone being offline and later receiving a notification once it is back online, your device must have a unique app-specific device token generated by Apple. You can then use a service such as FCM or AWS SNS to deliver the notification to clients.
Also, for Android, you will need to use GCM to generate the device token.
You can, for testing purposes, you can use react-native-push-notifications' PushNotification.localNotificationSchedule to create a dummy local notification.
Here is a good tutorial for setting up remote push notifications with APNS and FCM: https://www.appcoda.com/firebase-push-notifications/.