これは iOS 8 以前で動作していたので、iOS 9 ベータ版のバグであるか、動作が変更された可能性があります。
ユーザーにローカル通知を送信する許可を求めた後 -
NSSet *categories = ...;
UIUserNotificationType notificationTypes = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *notificationSettings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:categories];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
ユーザーが「許可」を選択すると、application:didRegisterUserNotificationSettings:
で呼び出され[notificationSettings types] == UIUserNotificationTypeNone
ます。
ただし、次に実行registerUserNotificationSettings
すると、正しいアクセス許可の種類で呼び出されます。
Apple の参考文献には、これが意図されていることを示すものは何も記載されていないため、バグである可能性があります。
何が問題なのか、それを回避する方法を知っている人はいますか?