푸시 알림에 등록하는 일반적인 방법은 Appdelegate에 다음 코드를 추가하는 것입니다. 어떤 인터넷 연결이없는 경우apns 푸시 알림을 등록하는 동안 인터넷 회의를 확인하는 데 필요합니까?
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
어떻게됩니까? 인터넷 연결이 다시 시작되면 응용 프로그램이 푸시 알림에 자동으로 등록하려고합니까?
필요한 인터넷 연결을 확인하고 이미 우리가 활성화 될 응용 프로그램이 추가 또한 경우 다음
if ([wifiConnection wifiConnectivity]){
if (![[NSUserDefaults standardUserDefaults] stringForKey:@"MyAppSpecificGloballyUniqueString"]) {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
}
}
처럼 푸시 알림에 등록하기 전에 조건을 등록하는 것을인가 - 그것이 내가 희망이 예상대로 작동합니다.
확인해주십시오.