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

swift-如何处理FCM通知而无需在IOS上键入弹出窗口

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

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

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

有人可以告诉我如何解决此问题吗?我的直觉是在AppDelegate中写的东西,但我已经有同样的过程func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]),并application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void)与其他功能有。谢谢!

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

后来我点击了APP图标,但通知没有得到处理,并且我的应用页面上没有数据更新。

那是意料之中的。如果你的应用收到了10条通知,并且你轻按了应用图标,那么你应该如何知道需要处理哪个通知呢?