Using Media Push

This SDK is developed using the Swift programming language. Unlike our existing iOS SDK, we provide integration support with Swift Package Manager (SPM). You can take advantage of Swift's expressive and intuitive nature, enabling you to create sophisticated applications with ease.

  1. Create a new Notification Service Extension to your application. In order to do that, follow these steps:

  • On Xcode click File -> New -> Target. Choose Notification Service Extension

  • Choose Notification Service Extension

  • After you selected Notification Service Extension new class named NotificationService will be created. It should be extended from MyNetmeraNotificationServiceExtension class. Your NotificationService class should look like the following:

import UserNotifications
import NetmeraNotificationServiceExtension

class NotificationService: NotificationServiceExtension {
  override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
    super.didReceive(request, withContentHandler: contentHandler)
  }

  override func serviceExtensionTimeWillExpire() {
    super.serviceExtensionTimeWillExpire()
  }
}
  1. In your pod file, add NetmeraNotificationServiceExtension and install to your extension target like this.

pod "NetmeraNotificationServiceExtension"

If you want to allow your application to receive http media contents:

  • Click Info.plist under NotificationService Extension

  • Add App Transport Security Settings

  • Under App Transport Security Settings add Allow Arbitrary Loads and set it YES.

Last updated