Step 1. add push notifications capability

Select your project and select your main target. Then go to Signing & Capabilities. Then click on + Capability and search for push notifications and add it.

image.png

Step 2. add background modes

Click on + Capability again and search for background modes. Add it and select Remote notifications.

image.png

Step 3. add Notification Service Extension

In order for MagicPush to keep track of the notification delivery status we need a notification service extension to be added. Go to file → New → Target, select Notification Service Extension and click next.

image.png

Change the Product Name to MagicPushNotificationServiceExtension and click on finish.

image.png

Be sure to click on Cancel when you get the Activate scheme prompt.

Step 4. add App Groups

Using App Groups allows your app and the MagicPushNotificationServiceExtension to communicate with the server when a notification is received, even when the app is not running.

Select your main app target → signing & capabilities and click on + Capability and search for App Groups.

image.png

Then click on the + button and set the container name to group.BUNDLE IDENTIFIER OF YOUR APP.magicpush. Where BUNDLE IDENTIFIER OF YOUR APP is the same as your main application bundle identifier.

image.png

Click OK and do the same for the MagicPushNotificationServiceExtension. Use the same container name as the main app target.

image.png