NSNumber* enabled = [Helper getBooleanPreference:[Config subscriptionsEnabled]]; if(enabled == nil || [enabled integerValue] == 1) { completionHandler(UIBackgroundFetchResultNewData); }解决方法 从 Apple documentation起
The sending of a silent notification requires a special configuration of the notification’s payload. If your payload is not configured properly,the notification might be displayed to the user instead of being delivered to your app in the background. In your payload,make sure the following conditions are true:
The payload’s aps dictionary must include the content-available key
with a value of 1.The payload’s aps dictionary must not contain the
alert,sound,or badge keys.
因此,您的推送应包含值为1的内容 – 不包含警报,声音或徽章键.
在这种情况下,如果要通知用户,则必须显示UIlocalnotification.
总结以上是内存溢出为你收集整理的应用程序在后台时跳过或禁用iOS通知全部内容,希望文章能够帮你解决应用程序在后台时跳过或禁用iOS通知所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)