【问题标题】:iOS Push notification not showing on LockScreeniOS 推送通知未显示在 LockScreen 上
【发布时间】:2014-09-13 13:26:04
【问题描述】:

在我的应用中,我有这个:

[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound];

但是,当我通过 ApnsPHP 从我的网络服务器发送通知时,徽章已实现,但锁定屏幕上没有消息。消息只能在通知中心找到。

我是否需要做更多的事情才能在锁定屏幕上启用通知?

【问题讨论】:

  • 您确定您已在系统偏好设置应用中启用您的应用以在锁定屏幕上显示其通知吗?
  • 是的,我已经检查过了。

标签: ios push-notification apns-php


【解决方案1】:

确保“请勿打扰”已关闭。转到“设置”>“请勿打扰”。

【讨论】:

    【解决方案2】:

    您好,您是用于推送通知的 json 格式不正确。请查看此article

    小例子:

    "aps": {
             "badge": 11,
             "alert": "Hello world!"
        }
    

    【讨论】:

    • 不应该由 ApnsPHP 库处理吗?
    • 调试并查看您得到的响应。从我的角度来看,JSON 格式不正确。
    猜你喜欢
    • 1970-01-01
    • 2021-09-29
    • 2017-12-16
    • 2021-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多