Develop

[ios] APNS, Remote Push 사용자가 수신을 동의했는지 확인하기

by hooni posted Oct 19, 2018
?

Shortcut

PrevPrev Article

NextNext Article

ESCClose

Larger Font Smaller Font Up Down Go comment Print

AppDelegate에 위의 메서드를 추가하면 수신 동의 후 device token 수령 성공/실패와 무관하게 push 다이얼로그에서 사용자의 선택이 허용인지 비허용인지를 알 수 있다.


- (void)application:(UIApplication *)application
    didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
    if ((notificationSettings.types & 1) == UIUserNotificationTypeNone) {
        NSLog(@"user selected NO");
    }
    else {
        NSLog(@"user selected YES");
    }
}