ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [iOS8] Push Notification 변경사항.
    0x05 Programming/iPhone Programing 2014. 10. 29. 20:32

    기존에 잘 쓰고있던 프로젝트에서 iOS8 업데이트 이후에 푸쉬키를 못얻어오는 현상이 발생하여 확인하여보니 

    약간의 변경이 있었던것 같습니다.


    // Before iOS 8:
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert |
                                                                          UIRemoteNotificationTypeBadge |

                                                                          UIRemoteNotificationTypeSound];



    // For iOS 8:

    UIUserNotificationSettings *settings =
        [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |
                                                     UIUserNotificationTypeBadge |
                                                     UIUserNotificationTypeSound
                                          categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];


    iOS 버전별 분기를 통하여 처리해주시면 될것 같습니다. 


Designed by Tistory.