Warm tip: This article is reproduced from serverfault.com, please click

how to process the FCM notification without typing the pop-out windows on IOS

发布于 2020-12-08 02:06:15

I am new to Swift and Firebase, I implemented the FCM perfectly, I am processing the data inside each notification and display it. However, I had a problem: Instead of tapping the pop-out windows of notification, I later tapped the APP ICON and the notification wasn't got processed and no data was updated on my app page.

Can someone please tell me how to fix this? My intuition is to write something in AppDelegate, but I had already had the same process in func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) and application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) as the other function has. Thank you!

Questioner
siiulan
Viewed
0
Honey 2020-12-08 10:46:42

I later tapped the APP ICON and the notification wasn't got processed and no data was updated on my app page.

That's expected. If your app has 10 notifications received and you tapped on the app icon, how is your suppose to know which notification it needs to process?