Muhammad Shauket
Muhammad Shauket

Reputation: 2778

Badge not showing on application icon iOS

I sent a push notification with a badge but it does not increase the number on an app icon. I see one thing under phone notification my app does not have an option for a badge. Anybody knows how I can badge option will appear under application setting in the notification window. notification image

Upvotes: 0

Views: 2531

Answers (1)

Muhammad Shauket
Muhammad Shauket

Reputation: 2778

Fix for this If you won't pass UNAuthorizationOptionBadge during requestAuthorizationWithOptions in a setting of your application notification does not show badge option and ultimately you will not receive badge notification whether from server-side you're sending a notification with a badge.

UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert + UNAuthorizationOptionSound + UNAuthorizationOptionBadge)
                      completionHandler:^(BOOL granted, NSError * _Nullable error) {
                        // Enable or disable features based on authorization.
                        [[Appboy sharedInstance] pushAuthorizationFromUserNotificationCenter:granted];
                      }];

Upvotes: 2

Related Questions