Open anhdo9797 opened 3 years ago
Hello, I also faced this issue, please help to give solution!!!
Hello, I also faced this issue, please help to give solution!!!
i found the solution that i added [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
the end function didReceiveRemoteNotification
. It is the line 147 in my code.
@anhdo9797 I am still getting the same
Warning: UNUserNotificationCenter delegate received call to -userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: but the completion handler was never called.
AppDelegate.m method updated
// Required for the notification event. You must call the completion handler after handling the remote notification.
Hello, I also faced this issue, please help to give solution!!!
i found the solution that i added
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
the end functiondidReceiveRemoteNotification
. It is the line 147 in my code.
thanks a lot it worked for me
Just comment the below function
// Required for localNotification event /void)userNotificationCenter:(UNUserNotificationCenter )center didReceiveNotificationResponse:(UNNotificationResponse )response withCompletionHandler:(void (^)(void))completionHandler { [RNCPushNotificationIOS didReceiveNotificationResponse:response]; }
than this Function will start working (void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
dependencies:
My issue: I received
Warning: Application delegate received call to -application:didReceiveRemoteNotification:fetchCompletionHandler: but the completion handler was never called.
when my app has notification from fcm in the foregroundMy
AppDelegate.m
:` ... @implementation AppDelegate
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
endif
RCTBridge bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@""
initialProperties:nil];
if (@available(iOS 13.0, *)) { rootView.backgroundColor = [UIColor systemBackgroundColor]; } else { rootView.backgroundColor = [UIColor whiteColor]; }
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible];
if ([FIRApp defaultApp] == nil) { [FIRApp configure]; }
[RNSplashScreen show]; [GMSServices provideAPIKey:GOOGLE_API_KEY];
// Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self;
return YES; }
(NSURL )sourceURLForBridge:(RCTBridge )bridge {
if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
endif
}
// Required for the register event.
@end `