I've been trying to register for push notification using Apigee SDK, but on some devices iPhone 5 and 6 don't receive push Notifications. More specifically, neither UIApplication delegate method
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
or
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
are not called.
I got this error when try to send the push notification
There was a problem delivering all of your notifications. See deliveryErrors in properties", "state": "FAILED", "deliveryErrors": [ "No devices for notification e438f4ca-4b46-11e5-8eb8-..." ],
I register with :
if ([self respondsToSelector:@selector(registerUserNotificationSettings:)]) {
// iOS 8 and higher
[self registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[self registerForRemoteNotifications];
} else {
// iOS 7 and lower
[self registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
}
On some devices the register is successful but in others not.