Configuring Push in iOS
APNS Certificate
First, you will have to create an APNS certificate and upload it to the dashboard to be able to send push notifications in iOS. Follow the steps below to do that:
- Create an APNS certificate
- Convert the resultant certificate to .pem format
- Upload .pem file to MoEngage Dashboard
Follow the links on each step to complete it.
Project Capability Changes
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. Also, we make use of silent pushes to track uninstalls. For tracking uninstalls of all the users, enable Remote Notification background mode in the app's capabilities as shown below:
Push Registration
After this you will have to register for push notification by using registerForPushNotification method of the plugin as shown below:
import 'package:moengage_flutter/moengage_flutter.dart';
final MoEngageFlutter _moengagePlugin = MoEngageFlutter();
_moengagePlugin.initialise();
_moengagePlugin.registerForPushNotification();
Rich Push and Templates Support
Please refer to the Native iOS SDK docs for supporting Rich Push(images/videos/audio in the notification) and Templates in the app: