如何在 IOS 上不键入弹出窗口 windows 来处理 FCM 通知

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

我是 Swift 和 Firebase 的新手,我完美地实现了 FCM,我正在处理每个通知中的数据并显示它。但是,我遇到了一个问题:我没有点击通知的弹出窗口 windows,而是后来点击了应用程序图标,但通知没有得到处理,我的应用程序页面上也没有更新任何数据。

有人可以告诉我如何解决这个问题吗?我的直觉是在 AppDelegate 中写一些东西,但我已经在 func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any])application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) 中进行了与其他函数相同的处理。谢谢!

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

这是意料之中的。如果您的应用收到了 10 条通知并且您点击了应用图标,您应该如何知道它需要处理哪个通知?