Follow the below steps to debug React Native iOS Push Notification
- If you are using RNFirebase, then check whether you are passing APNStoken and not the FCMToken from RNFirebase plugin.
- Check the debug URL -> https://web.freshchat.com/app/api/notif_debug?convId=%3Cidhere%3E
Ex: V2 link https://domain.freshchat.com/app/api/notif_debug?convId=1234567
If it is V2 migrated account, replace the word ‘web’ with your corresponding domain name and get the results. The user must be an account admin to get it. convId should be replaced with actual conversation id that is being checked.
If the response has “baddeviceToken” check your certificate and build (whether debug or prod both should be of the same type). If the response has pushEnabled as false, then the user must enable push notification for the application or ask the user to check in the mobile network.
- If the device token is properly sent and the debug URL is not showing baddevicetoken, then check whether the application is able to receive a notification on the background state. If this is not happening check the first step about APNSToken being passed.
- If the notification is not received when the app is in the foreground, this is related to the plugin you use. Ask them whether the callbacks are being called for notification lifecycles of the respective plugins. If not then please try the sample projects given for your reference.
Suggestion: These are the three sample React Native push notification implementations on iOS.
Native iOS implementation.
New RNFirebase support (>v6.x.x).
Old RNFirebase support (<=v5.x.x).
|Note||The 3 attachments in this article are sample projects for your understanding|
Steps to Run the project
Install NPM first.
Do pod install in the ios folder.
Add your app id and app key in index.js.
Add your bundle identifier in the project settings.
If RNFirebase is being used add your GoogleService-Info.plist inside the project.