Post

Replies

Boosts

Views

Activity

Reply to - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler will not get Called when App run in foreground
Just dealt with this yesterday...Implement UNUserNotificationCenterDelegate of UNUserNotificationCenter.currentNotificationCenter.And right on app launch, set that delegate, for example:[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];The method:- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandlerWill indicate how the notification will be presented once received, for example:completionHandler(UNAuthorizationOptionAlert | UNAuthorizationOptionSound | UNAuthorizationOptionBadge);Then the method:- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandlerWill indicate what to do after the user interacted with said notification. Don forget to call the completion handler!Good luck!
Apr ’20