【问题标题】:Push notification permission not being requested未请求推送通知权限
【发布时间】:2016-07-14 15:34:18
【问题描述】:

尝试在 iOS 应用中启用推送通知。已创建用于开发和分发的配置文件。

developer.apple.com 上已启用推送通知服务

但该应用不请求推送通知权限,也不注册推送 ID。更多 XCode 在功能选项卡中显示此消息

错误是由于配置文件设置不正确还是其他原因造成的?

【问题讨论】:

  • 请在您的AppDelegate中显示相关代码

标签: ios push-notification apple-push-notifications


【解决方案1】:

您是否已将此添加到您的 AppDelegate 文件中?

application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil))

如果这是在 swift 中

【讨论】:

    猜你喜欢
    • 2017-11-02
    • 2019-12-29
    • 2022-08-08
    • 1970-01-01
    • 2023-03-18
    • 2018-09-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-03
    相关资源
    最近更新 更多