ThomasCle
ThomasCle

Reputation: 6801

Debug UNNotificationServiceExtension without remote notifications

I am creating an UNNotificationServiceExtension, but I'd like to test it without having actual remote notifications while developing it.

Is it possible to trigger it without remote notifications?

I have tried with UNNotificationRequest, but that does not seem to work for the service extension. I have tested with UNNotificationContentExtension and that works, but it doesn't seem to work on UNNotificationServiceExtension.

Upvotes: 0

Views: 1084

Answers (2)

iSaalis
iSaalis

Reputation: 622

Download Pusher binary for mac. https://github.com/noodlewerk/NWPusher

It is cools. Give it keychain access, it picks the push certificates, just type in the payload and device token and environment and done.

Upvotes: 2

Jerry
Jerry

Reputation: 4480

I don't think you can with Local Notifications, but without a server, you can use the script from this tutorial: https://www.raywenderlich.com/123862/push-notifications-tutorial modified with the answer from this question: Push Notification in PHP using PEM file and send your own push notifications. You'll have to modify the content in the script to include the mutable-content flag to trigger the extension.

Upvotes: 0

Related Questions