Open hardikmehta88999 opened 2 years ago
@hardikmehta88999 You need to add some code in your AppDelegate.m file under iOS folder:-
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { ... // Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self;
return YES; }
//Called when a notification is delivered to a foreground app. -(void)userNotificationCenter:(UNUserNotificationCenter )center willPresentNotification:(UNNotification )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); }
This is what is mentioned in the documentation , but for some reasons it’s s still not working for me.
Yes, I also followed those steps in the documentation, but my app's notifications still do not appear at the top of the screen if the notification was received while the app is open in the foreground. 😪
check if onNotification
return data, then based on that data you can create a local push notification
Description: The push notification is coming to the real device when the app is in the foreground state but i don't know how to handle that notification in react native.