通知中心缺少 iOS 应用程序 [英] iOS application missing from notification center

查看:26
本文介绍了通知中心缺少 iOS 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:应用未出现在通知中心,安装完成后无法立即接收推送通知,应用通过 registerForRemoteNotificationTypes: 注册推送通知.

Problem: The app doesn't appear on notification center and it is unable to receive push notifications right after installation completes and the app registers for push notifications via registerForRemoteNotificationTypes:.

详情:

  • 该应用通常会在设备重启后出现在通知中心,之后一切正常.
  • 有时该应用会在安装和注册 APNs 后立即显示在通知中心(我仍然无法确认这一点,但我想我偶然发现了这种情况).
  • 应用在每次用户登录和每次用户注销时分别调用方法 registerForRemoteNotificationTypes 和位掩码 (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound) 和 UIRemoteNotificationTypeNone.
  • enabledRemoteNotificationTypes 返回正确的值.
  • 最初我在注销时使用了 unregisterForRemoteNotifications 方法,但由于怀疑这可能导致问题,我将其更改为 registerForRemoteNotificationTypes:UIRemoteNotificationTypeNone.
  • 无论是通过 xcode 还是 itunes 安装应用,都会在开发和临时构建中出现此问题.
  • The app usually appears in notification center after the device is restarted and after that everything works just fine.
  • Sometimes the app shows up in notification center right after intallation and registration for APNs(I still can't confirm this but I think I stumbled upon such situations).
  • The app calls the method registerForRemoteNotificationTypes each time a user logins and each time a user logouts respectively with bit masks (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound) and UIRemoteNotificationTypeNone.
  • enabledRemoteNotificationTypes returns correct values.
  • Initially I used the method unregisterForRemoteNotifications on logout but I changed it to registerForRemoteNotificationTypes:UIRemoteNotificationTypeNone due to suspicians that this could be causing the problem .
  • This problem occurs in both development and adhoc builds and irrespectively of whether the app is installed via xcode or itunes.

任何想法和建议将不胜感激.谢谢!

Any thoughts and advices will be greatly appreciated. Thank you!

推荐答案

这发生在我的一些设备上.(没有出现在通知中心,也没有收到推送.)

This was happening to some of my devices. (Not showing up in notification center and not receiving pushes.)

设法修复它:

  • 删除应用
  • 从设备中删除所有相关配置文件.设置应用程序 > 通用 > 配置文件,然后点击与您的应用程序相关的每个配置文件,然后点击删除.在 iOS 8/9 上,设置不再存在,使用 XCode > Windows > 设备 > 选择设备 > 显示配置文件... > 然后删除配置文件
  • 关闭手机,然后再打开.
  • 给 5 分钟
  • 重新安装您的应用,配置文件应该会自动安装.
  • 启动应用程序并让它注册等.
  • 再次测试推送通知

对我们来说,它没有立即起作用,所以给它几分钟.

For us, it didn't work immediately, so give it a few minutes.

这篇关于通知中心缺少 iOS 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆