【发布时间】:2015-02-26 09:43:06
【问题描述】:
我正在使用 iOS 8+ 上的推送通知。我尝试更新 UIUserNotificationSettings 值并将其取回进行比较,但它不一样。有人可以帮我解决/解释这个问题吗?非常感谢。
这是我的代码:
UIUserNotificationType types = UIUserNotificationTypeAlert | UIUserNotificationTypeSound;
NSLog(@"Before register: %u", types);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
UIUserNotificationSettings* currentSeting = [[UIApplication sharedApplication] currentUserNotificationSettings];
NSLog(@"After register: %u", currentSeting.types);
这里是输出控制台:
Before register: 6
After register: 0
【问题讨论】:
标签: ios iphone ios8 push-notification apple-push-notifications