NotificationServiceExtension not called
Asked Answered
B

0

3

After iOS 10 released, I use NotificationServiceExtension for image notification. It works fine. But I found something wrong recently.

Codes in UNNotificationServiceExtension not call anymore.

I'm not sure the cause so I create a new project for test. Unfortunately the new project not work neither.

I found something strange: Run extension in my device, locked screen, then push notification. Xcode raises this message(Extension is called obviously), unlocked and Xcode print "Program ended with exit code: 0".

enter image description here

Here is my payload:

{"aps" : {
        "alert" : {
            "title" : "Introduction To Notification",
            "subtitle" : "Session 707",
            "body" : "New Notification Look Amazing"
        },
       "sound" : "default",
        "category" : "message",
        "badge" : 1,
        "mutable-content": 1
    },
    "attachment-url": "https://api.buienradar.nl/Image/1.0/RadarMapNL"
}
Bishopric answered 28/9, 2017 at 7:45 Comment(2)
I saw this issue also several times with the new Xcode 9. Just try to run the app via Xcode -> run it with debugger mode -> lock your phone (without stopping your code execution in Xcode) -> send your push ... the push should then workGujral
Hi . did you solved this ?Double

© 2022 - 2024 — McMap. All rights reserved.