iOS 8 enabled device not receiving PUSH notifications after code update

后端 未结 8 2508
陌清茗
陌清茗 2020-11-27 03:45

I recently upgraded one of my test iphones to iOS 8 and then upgraded the PUSH registration code as below (using xCode 6)

-(BOOL)hasNotificationsEnabled {

          


        
8条回答
  •  生来不讨喜
    2020-11-27 04:06

    Its very simple:

    Add following line in didFinishLaunchingWithOptions of your project in xcode6

     [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
     [[UIApplication sharedApplication] registerForRemoteNotifications];
    

提交回复
热议问题