iOS的应用程序从通知中心失踪
问题描述:
问题:
该应用程序不会出现在通知中心,并通过 registerForRemoteNotificationTypes无法安装完成并推送通知的应用注册后立即收到推送通知:
详细内容:
- 重启设备后,一切都工作得很好后,应用程序通常出现在通知中心。
- 有时在应用程序通知中心显示了安装纸和登记的APN之后(我还无法证实这一点,但我觉得我在这样的情况下跌跌撞撞)。
- 应用程序调用该方法每次
registerForRemoteNotificationTypes
用户登录,每次分别在用户注销与位掩码(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound
)和UIRemoteNotificationTypeNone
。 -
enabledRemoteNotificationTypes
返回正确的值。 - 最初我用注销方法
unregisterForRemoteNotifications
,但我把它改为registerForRemoteNotificationTypes:UIRemoteNotificationTypeNone
由于suspicians这可能是造成问题的原因。 - 在这两种发展出现此问题,并即席构建和无关的应用程序是否利用x code或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
) andUIRemoteNotificationTypeNone
. -
enabledRemoteNotificationTypes
returns correct values. - Initially I used the method
unregisterForRemoteNotifications
on logout but I changed it toregisterForRemoteNotificationTypes: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.
有什么想法和建议将大大AP preciated。谢谢!
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,这里的设置不再存在,使用X code>窗口>设备>选择设备>显示配置文件...>然后删除该配置文件(S)
- 关闭手机,然后再打开。
- 给5分钟
- 重新安装应用程序,该供应配置文件应该得到自动安装。
- 启动应用程序,让它注册之类的东西。
- 测试再次推通知
对于我们来说,没有马上工作,所以给它几分钟。
For us, it didn't work immediately, so give it a few minutes.