简体   繁体   English

Firebase 云消息推送通知是否具有 IOS 的“contentAvailable”字段?

[英]Does Firebase cloud messaging push-notification have field "contentAvailable" for IOS?

Firebase Cloud Messaging config Firebase 云消息配置

  • I have a problem that when I push notification using API with field "contentAvailable": true, when in background (IOS) I can get data.我有一个问题,当我使用带有字段“contentAvailable”的 API 推送通知时:true,在后台(IOS)时我可以获得数据。 When I push notification using Firebase Cloud messaging, there is no "contentAvailable" field for me to set up for IOS. Can anyone explain problem to me?当我使用 Firebase 云消息推送通知时,没有“contentAvailable”字段可供我为 IOS 设置。有人可以向我解释问题吗?
  • I need to get "badge" when I am in background mode (IOS) to increase badge when I received message from Firebase. Anyone have any ideas?about this issue?当我处于后台模式 (IOS) 时,我需要获得“徽章”,以便在收到来自 Firebase 的消息时增加徽章。有人对这个问题有任何想法吗?

Yes - the contentAvailable or rather content_available field is also available for iOS. You can just add the field to your server request amongst other fields like for example badge .是的 - contentAvailable或更确切地说content_available字段也可用于 iOS。您可以将该字段添加到您的服务器请求中,以及其他字段,例如badge

To give an example and a brief overview for possible fields in your APNS payload out of the Python FCM Admin SDK look below (the contentAvailable field is also available in other SDKs):举一个例子,并简要概述 Python FCM Admin SDK 中 APNS 负载中的可能字段,请看下面( contentAvailable字段在其他 SDK 中也可用):

https://firebase.google.com/docs/reference/admin/python/firebase_admin.messaging (Taken from official documentation here ) (取自此处的官方文档)

With the fields you can configure your badges and their behavior.使用这些字段,您可以配置徽章及其行为。

There are also for example Android specific parameters.还有例如 Android 特定参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 云消息 - 手机收不到推送通知 - Firebase Cloud Messaging - Mobile not receiving push notification 未收到通过 iOS 应用程序中的 firebase 云功能发送的推送通知,尽管我从消息控制台获取 - Not receiving push notification sent via firebase cloud functions in iOS app though I get the from messaging console 使用 curl 发送数据推送通知 firebase 云消息 - Using curl to send data push notification with firebase cloud messaging Firebase Cloud Messaging 静默推送通知无法正常工作 - Firebase Cloud Messaging Silent Push Notification fail to work 如何使用 Firebase Cloud Messaging 安排本地推送通知? - How do I schedule a local push notification with Firebase Cloud Messaging? 在 Kotlin 客户端应用程序中发送 FCM 推送通知 - Firebase 云消息传递 - Sending FCM Push Notification in Kotlin Client App - Firebase Cloud Messaging Firebase 云消息删除通知 - Firebase Cloud Messaging deleting notification 如何处理点击推送通知(Firebase Cloud Messaging)? - How to handle click on push notification (Firebase Cloud Messaging)? Firebase 云消息通知震动 - Firebase Cloud Messaging Notification Vibration Firebase 通知 admin.messaging() 不是 function - Firebase 云消息传递 - Firebase notification admin.messaging() is not a function - Firebase cloud messaging
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM