gpt4 book ai didi

ios - didReceiveRemoteNotification 函数调用了两次

转载 作者:行者123 更新时间:2023-11-29 05:50:33 25 4
gpt4 key购买 nike

我正在使用 firebase 云消息传递通过自定义 JSON 负载实现推送通知,并且它正在运行。

我现在面临的问题是当我触发通知时,didRecieve 被调用,当用户点击通知警报时,它会再次被调用。

我正在导航到 didRecieve 中的其他 viewcontroller,所以在我的例子中,两次导航到同一个 vc。

我该如何解决这个问题?

最佳答案

如果您正在实现 application(_:didReceiveRemoteNotification:fetchCompletionHandler:),这可能是预期的行为,如所述 here in the docs :

Note

If the user opens your app from the system-displayed alert, the system may call this method again when your app is about to enter the foreground so that you can update your user interface and display information pertaining to the notification.

关于ios - didReceiveRemoteNotification 函数调用了两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55713082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com