Vipul Gupta
Vipul Gupta

Reputation: 265

Notification Service Extension not getting invoked in macOS

I have created a Notification service extension as target to the main MacOS application. I want to update the content of my remote notification using this extension but due to some reason the extension is not getting invoked to update my remote notification.

The auto execution of the below method seems to fail in the Notification Service

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

I have tried all the suggested solutions in this link but it did not help. Maybe there are some differences to using Notification service for MacOS and ios that I m not aware.

I am able to send normal remote notifications using the curl command, but it is not invoking the service extension. Below is the curl command.

curl -v --header "apns-topic: $TOPIC" --header "apns-push-type: alert" --header "authorization: bearer $AUTHENTICATION_TOKEN" --data '{"aps": {"mutable-content": 1,"alert": {"title": "Encrypted title","body": "Encrypted body"}},"MEETING_ORGANIZER": "MyMeet"}' --http2 https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN}

Is there anything I m missing that is causing this problem?

Upvotes: 1

Views: 93

Answers (0)

Related Questions