简体   繁体   中英

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

Firebase Cloud Messaging config

  • I have a problem that when I push notification using API with field "contentAvailable": true, when in background (IOS) I can get data. 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?
  • 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?

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 .

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):

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM