Commit 9de7f2a0 by Maurits van Beusekom Committed by GitHub

Merge pull request #289 from open-xchange/fix_notification_strategy_ios

iOS NotificationPermissionStrategy: Fixes wrong completionHandler call
parents 30314d66 2bd3b802
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
completionHandler(PermissionStatusDenied); completionHandler(PermissionStatusDenied);
return; return;
} }
[[UIApplication sharedApplication] registerForRemoteNotifications];
completionHandler(PermissionStatusGranted);
}]; }];
} else { } else {
UIUserNotificationType notificationTypes = 0; UIUserNotificationType notificationTypes = 0;
notificationTypes |= UIUserNotificationTypeSound; notificationTypes |= UIUserNotificationTypeSound;
...@@ -45,9 +49,10 @@ ...@@ -45,9 +49,10 @@
notificationTypes |= UIUserNotificationTypeBadge; notificationTypes |= UIUserNotificationTypeBadge;
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
}
[[UIApplication sharedApplication] registerForRemoteNotifications]; [[UIApplication sharedApplication] registerForRemoteNotifications];
completionHandler(PermissionStatusGranted); completionHandler(PermissionStatusGranted);
}
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment