0

나는 UIUserNotificationSettingsUIUserNotificationTypeBadge을 설정하고 있지만, 통지가 도착했을 때 여전히 배지 앱에 표시되지 않습니다.
이유와 그 경우 해결책이 무엇일 수 있습니다.아이폰 OS 푸른 푸시 알림 응용 프로그램 배지

UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeSound | 
              UIUserNotificationTypeAlert | UIUserNotificationTypeBadge categories:nil]; 

답변

2

알림 페이로드에 배지 값을 설정해야합니다. 여기

당신은 여기에 페이로드에 대해 자세히 알아볼 수 있습니다 5.

{ 
    "aps" : { 
     "alert" : { 
      "title" : "Game Request", 
      "body" : "Bob wants to play poker" 
     }, 
     "badge" : 5 
} 

에 배지를 설정합니다 샘플 코드입니다. https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html

+0

그러나 애플리케이션 배지는 didRecievePushNotification 외부에 설정해야합니다. 이 함수는 푸시 알림을 열 때 호출됩니다. 나타나지 않을 때. 그것은 운영 체제 및 알림 서비스 API의 손에 있습니다. 이 경우 하늘빛. – Nitish

+0

나는이 배지를 얻고 있지만 값이 증가하지는 않습니다. 앱 배지 값이 이전에 1이었던 것으로 가정하고 새 알림이 도착했습니다. 이상적으로 앱 배지 값은 2 여야합니다.하지만 여전히 1을 표시하고 있습니다. – Nitish

+0

서버에서 관리해야합니다. 배지 값을 2로 표시하려면 "배지"를 보내야합니다. 2. iOS는 알림 페이로드에 보내는 최신 배지를 표시합니다. –