NotificationServiceExtension not called

▼魔方 西西 提交于 2020-01-14 13:35:30

问题


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".

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"
}

来源:https://stackoverflow.com/questions/46463680/notificationserviceextension-not-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!