0

I'm using an iphone with ios 9.3

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    UIUserNotificationType types = (UIUserNotificationType) (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert);

    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];

    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];

    return YES;
}

After the notification registration this method is call:

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
    //register to receive notifications
    [application registerForRemoteNotifications];
}

After the [application registerForRemoteNotifications], the system popup appears, i accept the notification but the method:

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *) deviceToken 

Is never call, what am i missing?

This works great on ios 8

Jordan
  • 21
  • 1
  • 5

1 Answers1

0

ok it may sound stupid but it started to work, without changing a line of code... This happened after rebooting wifi router and computer, maybe the router has blocking the connection.

Thanks for your answesr, and if someone is having similar problem check out this post: didRegisterForRemoteNotificationsWithDeviceToken not called in ios8, but didRegister...Settings is

Community
  • 1
  • 1
Jordan
  • 21
  • 1
  • 5