I developed an application and used FCM to handle notifications. When the application is in background and a notification received, by clicking on the notification the application:didReceiveRemoteNotification:
is called and everything is ok! but if the app is opened with other ways like tapping on the app icon, the application:didReceiveRemoteNotification:
function is not called and the notification stays unread.
I know this is how it works but i want whenever there is a notification and no matter how the app opened the application:didReceiveRemoteNotification:
called!
Asked
Active
Viewed 366 times
1

Negar Moshtaghi
- 463
- 1
- 6
- 21
-
`didFinishLaunchingWithOptions ` check the launching options dictionary --> What you are looking for – Prashant Tukadiya Mar 01 '19 at 12:13
-
`func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)` method called when we tapped on notification bar in foreground – Shabbir Ahmad Mar 01 '19 at 12:20
-
See https://stackoverflow.com/questions/30364315/how-to-clear-the-remote-notification-in-your-app – Gaurav Chandarana Mar 01 '19 at 12:46