Is it possible to update application badge count by receiving a silent push.
When the application is not running in the background, this method is not called. My guess is this method get called even if the app is not running in the background. Am I wrong?
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{
int currentBadge = [UIApplication sharedApplication].applicationIconBadgeNumber;
DLog(@"%@, badge = %i", userInfo, currentBadge);
[UIApplication sharedApplication].applicationIconBadgeNumber = [UIApplication sharedApplication].applicationIconBadgeNumber + 1;
completionHandler(UIBackgroundFetchResultNoData);
}
I just want to increase badge number with any received notification. The notification payload do not have a "badge' field.
Is it possible?
And if the app does not run background, UIApplicationExitsOnSuspend = YES, I wonder in this situation will silent push work or not?