【问题标题】:Debug UNNotificationServiceExtension without remote notifications在没有远程通知的情况下调试 UNNotificationServiceExtension
【发布时间】:2017-03-01 00:46:48
【问题描述】:

我正在创建一个UNNotificationServiceExtension,但我想在开发时测试它而不需要实际的远程通知。

是否可以在没有远程通知的情况下触发它?

我已尝试使用UNNotificationRequest,但这似乎不适用于服务扩展。我已经用UNNotificationContentExtension 进行了测试并且可以正常工作,但它似乎不适用于UNNotificationServiceExtension

【问题讨论】:

    标签: ios swift apple-push-notifications ios10


    【解决方案1】:

    下载适用于 mac 的 Pusher 二进制文件。 https://github.com/noodlewerk/NWPusher

    很酷。给它钥匙串访问权限,它选择推送证书,只需输入有效负载和设备令牌和环境即可。

    【讨论】:

      【解决方案2】:

      我认为您不能使用本地通知,但如果没有服务器,您可以使用本教程中的脚本:https://www.raywenderlich.com/123862/push-notifications-tutorial 修改此问题的答案:Push Notification in PHP using PEM file 并发送您自己的推送通知。您必须修改脚本中的内容以包含 mutable-content 标志以触发扩展。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-10-05
        • 1970-01-01
        • 1970-01-01
        • 2023-03-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-09-10
        相关资源
        最近更新 更多