- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 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/
在我的应用程序中,我有两种类型的推送通知:带有 content-available = 1 标志的远程静默通知和带有 body、badge< 的普通推送通知 和其他东西。 我还定义了两个委托(dele
如果我覆盖 override func application(application: UIApplication, didReceiveRemoteNotification userInfo: [
我对apns问题感到疯狂。 我正在测试 apns 推送通知。我可以很好地收到推送消息。 但是现在出了大问题。我想告诉我的情况如下。 当我的应用程序运行时,didReceiveRemoteNotific
此类问题已被问过多次,但我遇到了一些具体情况。 当我的应用程序处于事件状态并且收到推送消息时,我能够成功解析自定义负载等。 但是,当我的应用程序在后台并且推送到达时,用户必须单击“查看/打开”按钮才能
我已经使用 FCM 实现了推送通知。当我的应用程序位于前台并且通知到达时,将调用 didReceiveRemoteNotification 方法,但当应用程序未处于事件状态时,它不会调用此方法 当应用
我正在做项目,因为推送通知是关键功能之一。当我在应用程序中时它工作正常,我收到通知并处理该通知。 但问题是当我的应用程序处于非事件状态或删除应用程序的实例时。在这种情况下,我收到了未调用 didRec
我正在使用 firebase 云消息传递通过自定义 JSON 负载实现推送通知,并且它正在运行。 我现在面临的问题是当我触发通知时,didRecieve 被调用,当用户点击通知警报时,它会再次被调用。
我的应用程序委托(delegate)有一个 RootViewController *viewController;应用程序将以此 View 启动。 从现在开始,当用户导航到应用内的不同功能时,我将继续
应用程序委托(delegate)之外有类似的东西吗?我只是希望在收到通知时能够在 View Controller 中执行某些操作。我是否只需导入它们中的每一个并根据我当前的 View Controll
实时应用程序发生崩溃。我无法获取崩溃日志。我可以在“管理器”->“崩溃”中看到以下内容,单击它会将我带到下面提到的以下行。如何调试或防止此崩溃? Crash in Organizer func app
我正在尝试使用 Apple 推送通知。除了应用程序处于后台时之外,一切正常。 回调方法DidRecieveRemoteNotification有时不会在收到通知后立即调用。有时需要超过 5 分钟才能调
我目前正在开发一个需要调整 AppDelegate 应用程序的产品:didReceiveRemoteNotification:(我不想在 appDelegate 本身中调用我的新方法)。 问题是:调配
似乎如果我同时向同一设备发送多个推送通知,则不会为每个发送的通知调用 didReceiveRemoteNotification。假设我发送了 6 个通知,didReceiveRemoteNotific
我已经在我的应用程序中实现了推送通知。 当我的应用程序在前台时,我的应用程序运行正常。 但是当应用程序在后台或被杀死时,我的 didReceiveRemoteNotification 调用了两次。 我
我正在处理推送通知,我收到的数据是 JSON 格式的。如何解析 JSON 数据,如下面的通知中心所示: 最佳答案 如果您的应用处于后台/前台模式,请调用此方法 - (void)application:
我已经实现了我的 didReceiveRemoteNotification 方法。它工作并显示一个 View Controller ,其中包含传递的通知数据。这仅在应用程序已经在前台或在后台运行时才有
我正在开发一个包含大量遗留代码的大型应用程序。目前 - 有一个实现: - (void) application:(UIApplication *)application didReceiveRemot
我的应用配置为支持静默推送(内容可用),还支持后台获取。我需要实现的是在收到静默推送后,我需要向服务器发送 ajax 请求,取回数据并保存(使用 CoreData 保存)。 当然,所有这一切都是在用户
我正在尝试从 didReceiveRemoteNotification 生成一个联合发布者 类似于下面的这段代码: NotificationCenter.default.publisher(for:
由于某种原因,我的 didReceiveRemoteNotification 从未被调用。我已完成以下操作: APNS list : 创建允许推送通知的 AppId 使用有效证书和应用 ID 创建 S
我是一名优秀的程序员,十分优秀!