【发布时间】:2015-05-26 19:36:22
【问题描述】:
- 我有如下代码。
- 我去了通知中心并为我的应用禁用了所有警报、徽章、在锁定屏幕上显示
- 但下面的代码在我预期为 false 时仍然返回 true。
-
我应该检查什么以使通知中心的应用程序禁用设置为假
-(BOOL)pushEnabled { BOOL enabled = NO; if ([[UIApplication sharedApplication] respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { enabled = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications]; } else { UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; enabled = types & UIRemoteNotificationTypeAlert; } return enabled; }
【问题讨论】:
标签: ios objective-c