Giuseppe Roberto Rossi
Giuseppe Roberto Rossi

Reputation: 796

iOS10 NotificationService Extension

The method:

didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler:(UNNotificationContent) -> Void)

of iOS 10's NotificationService TARGET is not triggered automatically by iOS, even if the payload of my remote notification contains the attribute: "mutable-content" : 1.

Here you are the payload example:

    {
  "aps": {
    "alert": {
      "body": "body",
      "subtitle": "subtitle",
      "title": "title"
    },
    "mutable-content": 1
  }
}

Is there any missing configuration or code do I have to implement in order to make it works ?

Upvotes: 3

Views: 1466

Answers (1)

Raz
Raz

Reputation: 2643

You should run the application with the extension as a target, and choose the app you would like the extension to work with. Typically you will run the extension on the application in the containing project.

Run the extension.

After running the Extension target, your app will load, and when you will send notifications with "mutable-content : 1", you will be able to step in debug mode.

Upvotes: 6

Related Questions