0

자습서 "Here"은 다소 혼란 스럽기 때문에 누구나 이미이 기능을 구현했는지 궁금합니다. 앱은 'UA의 자동 표시'기능을 사용하며 앱이 열렸을 때 배지 번호가 지워지지 만 0으로 재설정되지 않습니다. 따라서 새로운 알림이 도착하면 배지 번호는 영원히 증가합니다.Urban Airship iOS 배지가 0으로 재설정되지 않음

내가 didFinishLaunchingWithOptions에있는 코드는 다음과 같습니다 내가 잘못하고있는 중이 야 사소한 일이

UAConfig *config = [UAConfig defaultConfig]; 
[config setAutomaticSetupEnabled:NO]; 
[[UAPush shared] setNotificationTypes:UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert]; 
[[UAPush shared] registerForRemoteNotifications]; 
[UAirship takeOff:config]; 
[[UAPush shared] setAutobadgeEnabled:YES]; 
[[UAPush shared] resetBadge]; 
[[UIApplication sharedApplication] cancelAllLocalNotifications]; 

있습니까? 아무도이 일을 할 수 있니?

미리 감사드립니다.

답변

0

나는이 있고이 메시지를 읽고되면 배지 웁니다

- (void)applicationWillResignActive:(UIApplication *)application{ 
// Set the application's badge to the number of unread messages 
if ([UAInbox shared].messageList.unreadCount >= 0) { 
    [[UIApplication sharedApplication] setApplicationIconBadgeNumber:[UAInbox shared].messageList.unreadCount]; 
}}