To send push notifications to iOS users, it is required to generate the APNs Auth Key file for your application and upload it to the MoEngage dashboard. Refer the link to generate Auth key.
First you will have to create an APNS certificate and upload in the dashboard to be able to send push notifications in iOS. Follow the steps below to do that :
Once the APNS Certificate is uploaded, enable Push Entitlement in the Xcode project. For that select your app target, then go to Capabilities. Here enable the Push Notifications capability for your app as shown below :
We make use of silent pushes to track uninstalls. For tracking uninstalls of all the users, enable Remote Notification background mode in-app capabilities for the same as shown below :
After this you will have to register for push notification by using registerForPush method of the plugin as shown below :
//This is only for iOSimport ReactMoE from 'react-native-moengage'ReactMoE.registerForPush();
Plugin gets all the remote notification-related callbacks, therefore you won’t receive any of them in your AppDelegate. Therefore, you will have to add observers for the notifications provided by plugin instead.