ho ottenuto il pop-up, ho accettato, lo vedo nelle notifiche ed è acceso ma questo codice non restituisce sempre e non posso sembrano scoprire perchéisRegisteredForRemoteNotifications restituisce sempre no
UIApplication *application = [UIApplication sharedApplication];
BOOL enabled;
// Try to use the newer isRegisteredForRemoteNotifications otherwise use the enabledRemoteNotificationTypes.
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
enabled = [application isRegisteredForRemoteNotifications];
}
else
{
UIRemoteNotificationType types = [application enabledRemoteNotificationTypes];
enabled = types & UIRemoteNotificationTypeAlert;
}
if (enabled){
NSLog(@"is registered");
}else{
NSLog(@"is not registered");
}
Quando ti registri per le notifiche è 'UIRemoteNotificationTypeAlert' uno dei tipi per cui ti sei registrato? –