Media Push
Step 1: Create a New Notification Service Extension
To create a new Notification Service Extension to your application:
On Xcode click File > New > Target. Choose
Notification Service Extension
Choose
Notification Service Extension
A new class named
NotificationService
will be created. It should be extended fromMyNetmeraNotificationServiceExtension
class.
Your NotificationService
class should look like the following:
Optional: Integrating Notification Service Extension Using CocoaPods
If you're using a Podfile for dependency management, follow these steps along with the rest of the steps from 1 to 5:
Add
NetmeraNotificationServiceExtension
in your Podfile:Install it to your extension target.
Note: If you're not using CocoaPods, you can skip this step.
Step 2: Add Your AppGroupName
AppGroupName
Add your
AppGroupName
in your Netmera-Config.plist.
Step 3: Select Targets in Target Membership
Select all three targets in the Target Membership section on the right.
Step 4: Select Main Project & Service Extension
Go to Notification Service > Target Membership.
Select both the main project and the service extension.
Step 5: Receiving Http Media Contents
Sample Service Extention Info.plist
If you want to allow your application to receive http media contents:
Click
Info.plist
under Notification Service Extension,Add App Transport Security Settings,
Add Allow Arbitrary Loads under App Transport Security Settings and set it to YES.
Troubleshooting
If push notifications do not display correctly:
Go to Build Settings > Runpath Search Paths in the extension target. Ensure the following paths are added:
Remove the default label in MainInterface.
Last updated
Was this helpful?