@@ -112,7 +112,9 @@ HsStablePtr global_didFailToRegisterForRemoteNotificationsWithError = 0;
112112- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
113113 // Sent when the application receives remote notifications in the foreground or background
114114 // TODO Allow a configurable CString -> IO () to be passed into AppDelegateConfig
115− [UIApplication sharedApplication].applicationIconBadgeNumber=[[[userInfo objectForKey:@"aps"] valueForKey:@"badge"] intValue];
115+ if ([userInfo valueForKeyPath:@"aps.badge"] != nil) {
116+ [UIApplication sharedApplication].applicationIconBadgeNumber=[[[userInfo objectForKey:@"aps"] objectForKey:@"badge"] intValue];
117+ }
116118 completionHandler(UIBackgroundFetchResultNewData);
117119}
118120