设备令牌不在ios 8.1中生成

设备令牌不在ios 8.1中生成,第1张

概述我已使用以下方法实现了推送通知生成. if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){ [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTy 我已使用以下方法实现了推送通知生成.

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0){    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categorIEs:nil]];    [[UIApplication sharedApplication] registerForRemoteNotifications];}else{    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];}

设备令牌正常生成.但是,当关闭声音和徽章应用程序图标并将警报样式设置为无(设置 – >应用程序名称 – >通知)时,设备令牌不会生成.此问题仅发生在iOS 8设备中.在iOS 7设备中,它正常工作.任何人都可以为此提供解决方案.

@H_502_16@解决方法 这更像是iOS7的一个BUG.通知有3种方式提示给用户:声音/徽章/警报.
如果禁用声音和徽章,并且如果将“警报”样式设置为“无”(即禁用警报),则无法显示通知.

我认为这是电池优化:如果无法通知用户,为什么要将他注册到远程通知?

总结

以上是内存溢出为你收集整理的设备令牌不在ios 8.1中生成全部内容,希望文章能够帮你解决设备令牌不在ios 8.1中生成所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1005371.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存