0

나는이 메시지를 tutorial에 따라 iOS에서 푸시 알림을 수신하는 것처럼 설정합니다.사과 푸시 알림 소리가 들리지 않습니다. iOS 8.1.3

if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { 
    [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeAlert | UIUserNotificationTypeSound) categories:nil]]; 
    [application registerForRemoteNotifications]; 
} else { 
    [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; 
} 

내가 등록있어 (내가 deviceToken를 얻을 수 있어요)와 보낼 때 내가 푸시 알림의 메시지를 얻을 수 있습니다, 문제가 있다는 것입니다 :

나는이와 엑스 코드에 didFinishLaunchingWithOptions을 설정 , 나는이 같은 문제를 가지고 아이폰 OS

답변

0

8.1.3을 사용하고

$body['aps'] = array(
    'alert' => $message, 
    'sound' => "default" 
    ); 

등이 보인다 : 나는 모든 알림 음을 재생 얻을 수없는, 내 pusher.php이 같다 아래 코드는 더 이상 사용되지 않습니다.

if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) 
{ 
    [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | 
                           UIUserNotificationTypeAlert | 
                           UIUserNotificationTypeBadge) categories:nil]]; 
    [application registerForRemoteNotifications]; 
} 
else 
{ 
    [application registerForRemoteNotificationTypes: 
    (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; 
} 

if (application) { 

    application.applicationIconBadgeNumber = 0; 

    if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]){ 
     [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert| 
                 UIUserNotificationTypeBadge| 
                 UIUserNotificationTypeSound categories:nil]]; 
    } 
} 
return YES;} 

앱 내 로컬 알림 만 수신합니다. 이것에 올바른 인증서를 부여한 후에도. 지금까지 Iv가 이에 대한 도움을 찾지 못 했으므로 Apple Developer Technical Support (기술 지원)에게 이메일을 보냈습니다.

+0

이 문제가있는 행운을 빕니다. –

+0

안녕하세요. Apple에서 보낸 답장입니다. – Jonas

+0

Apple Push Notification 서비스에 관한 질문에 응답하고 있습니다. 푸시 알림에 영향을주는 iOS 8.1.3의 API 변경 사항이 없습니다. 혹시 iOS 7 SDK에서 업그레이드하셨습니까? 사용자 알림을 표시 할 수있는 권한 요청은 iOS 8 SDK에 푸시 알림 등록과 분리되었습니다. 이는 iOS 8 SDK로 제작 된 앱에만 영향을 미칩니다. 이전 SDK로 작성된 앱은 이전과 동일하게 작동해야합니다. – Jonas