2016-06-22 3 views
0

백 엔드에서 이벤트를 추가 할 때이있는 iOS 프로젝트가 하나 있습니다. 모두 잘 작동합니다. badge, alert, sound 모두 표시됩니다 (단, 'banner'제외). 앱이 배경 모드에있을 때 배너가 표시되지 않는다면 Google 측에서 '배너'를 코딩 할 수있는 코드가 없다고 생각합니다. 이것은 내가 pushnotification에 등록하는 방법입니다.푸시 알림 배너가 표시되지 않음 - ios9

UIUserNotificationType types = UIUserNotificationTypeBadge | 
     UIUserNotificationTypeSound | UIUserNotificationTypeAlert; 

     UIUserNotificationSettings *mySettings = 
     [UIUserNotificationSettings settingsForTypes:types categories:nil]; 

     [[UIApplication sharedApplication] registerUserNotificationSettings:mySettings]; 
     [[UIApplication sharedApplication] registerForRemoteNotifications]; 
+0

시뮬레이터 나 iDevice에서 앱을 실행하고 있습니까? 푸시 알림은 시뮬레이터에 표시되지 않습니다. –

+0

기기 토큰을 등록하셨습니까? –

+0

@GijsSotthewes 기기에서 실행 중이고 모든 알림을 받고 있습니다. 알림이 실행되는 동안에 만 배너를 표시하는 데 문제가 있습니다. –

답변

0

백엔드에서 보내는 페이로드가 허용 된 크기 제한을 초과했기 때문입니다. 허용되는 official doc 최대 크기 당으로 은 다음과 같습니다

일반 원격 알림
  • , 최대 크기는 4킬로바이트 (4096 바이트) 인터넷 전화 (VoIP) 알림
  • 이며, 최대 크기는 5킬로바이트입니다 (5120 bytes) NOTE