I am working with push notification on iOS 8+. I try to update UIUserNotificationSettings values and get it back to compare, but it does not the same. Could someone help me resolve/explain this issue for me. Many thank.
Here is my code:
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);
Here is output console:
Before register: 6
After register: 0
Aucun commentaire:
Enregistrer un commentaire