确定iPhone,如果用户启用了推送通知 [英] Determine on iPhone if user has enabled push notifications
本文介绍了确定iPhone,如果用户启用了推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种方法来确定用户是否有,通过设置,启用或禁用它们的推送通知我的应用程序。
I'm looking for a way to determine if the user has, via settings, enabled or disabled their push notifications for my application.
推荐答案
通话enabledRemoteNotificationsTypes并检查面罩。
call enabledRemoteNotificationsTypes and check the mask.
例如:
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
if (types == UIRemoteNotificationTypeNone)
// blah blah blah
iOS8上及以上:
iOS8 and above:
[[UIApplication sharedApplication] isRegisteredForRemoteNotifications]
这篇关于确定iPhone,如果用户启用了推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文