Vote count:
0
Two questions about changes in iOS8 for the user to accept push notifications (as well as notifications such as badges and so).
1) I am using the current approach which is working fine both on iOS7 and iOS8
if ([[[UIDevice currentDevice] systemVersion] floatValue]>= 8.0) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge
|UIUserNotificationTypeSound
|UIUserNotificationTypeAlert) categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
This is completely working as push and alert are working and I got the token in the didRegister delegate method, but I am never asked with a pop-up as it used to be the case. Even if I completely delete the app from my phone? Why that? Does the OS keep in memory privacy settings for apps even if they have been deleted ?
2) I saw some people suggesting to ask for remote notifications in the following delegate
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
NSLog(@"registered for notifications settings %@",notificationSettings);
//register to receive notifications
[application registerForRemoteNotifications];
}
Why that ?
asked 2 mins ago
iOS8 - Asking for remote push notifications
Aucun commentaire:
Enregistrer un commentaire