Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Con la API de HTTP
v1 de Firebase Cloud Messaging, puedes enviar,
actualizar y finalizar de forma remota las notificaciones de actividad en vivo en dispositivos iOS. Ten en cuenta que necesitas
iOS 16.1 para usar la actividad en vivo y iOS 17.2 para iniciar de forma remota una notificación de
actividad en vivo.
Para iniciar una actividad en vivo de forma remota con Firebase Cloud Messaging, debes
obtener un token
push-to-start
de Apple. También necesitarás el token de registro de
FCM para la
app de destino.
Para actualizar una actividad en vivo de forma remota con Firebase Cloud Messaging, debes
obtener un token push
de Apple. También necesitarás el token de registro de
FCM para la
app de destino.
Para finalizar una actividad en vivo con Firebase Cloud Messaging, debes obtener un token
push
de Apple. También necesitarás el token de registro de
FCM
para la app de destino.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-05 (UTC)"],[],[],null,["\u003cbr /\u003e\n\nWith the Firebase Cloud Messaging [HTTP v1\nAPI](/docs/reference/fcm/rest/v1/projects.messages/send), you can remotely send,\nupdate, and end live activity notifications on iOS devices. Note that you need\niOS 16.1 to use live activity and iOS 17.2 to remotely start a live activity\nnotification.\n\nBefore you begin\n\nBefore you get started with live activity on Firebase Cloud Messaging, follow the\ninstructions in [Set up a Firebase Cloud Messaging client app on Apple\nplatforms](/docs/cloud-messaging/ios/client) to create and add\nFirebase Cloud Messaging to your client app.\n\nStart a live activity\n\nTo start a live activity remotely using Firebase Cloud Messaging, you need to\nobtain a [push-to-start\ntoken](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Start-new-Live-Activities-with-ActivityKit-push-notifications)\nfrom Apple. You will also need the [FCM registration\ntoken](/docs/cloud-messaging/ios/client#access_the_registration_token) for the\ntarget app.\n\nTo construct a [payload that starts a live\nactivity](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Construct-the-payload-that-starts-a-Live-Activity),\nfill in the\n[`apns.payload`](/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig) field\nfrom the following code sample to remotely start a live activity using\nFCM. You can use the [API\nExplorer](/docs/reference/fcm/rest/v1/projects.messages/send?apix=true&apix_params=%7B%22parent%22%3A%22projects%2F%3Cproject_number%3E%22%2C%22resource%22%3A%7B%22message%22%3A%7B%22token%22%3A%22%3Cfcm_token%3Atest%3E%22%2C%22apns%22%3A%7B%22live_activity_token%22%3A%22%3Clive_activity_push_to_start_token%3E%22%2C%22headers%22%3A%7B%22apns-priority%22%3A%2210%22%7D%2C%22payload%22%3A%7B%22aps%22%3A%7B%22timestamp%22%3A%22%3Ctimestamp%3E%22%2C%22event%22%3A%22start%22%2C%22content-state%22%3A%7B%22demo%22%3A1%7D%2C%22attributes-type%22%3A%22DemoAttributes%22%2C%22attributes%22%3A%7B%22demoAttribute%22%3A1%7D%2C%22alert%22%3A%7B%22title%22%3A%22test%20title%22%2C%22body%22%3A%22test%20body%22%7D%7D%7D%7D%7D%7D%7D)\nto construct and test your payload. \n\n```gdscript\n\"message\":{\n \"token\": \"\u003cfcm_token:test\u003e\",\n \"apns\":{\n \"live_activity_token\": \"\u003clive_activity_push_to_start_token\u003e\",\n \"headers\":{\n \"apns-priority\": \"10\"\n },\n \"payload\":{\n \"aps\": {\n \"timestamp\": \u003ctimestamp\u003e,\n \"event\": \"start\",\n \"content-state\": {\n \"demo\": 1\n },\n \"attributes-type\": \"DemoAttributes\",\n \"attributes\": {\n \"demoAttribute\": 1,\n },\n \"alert\": {\n \"title\": \"test title\",\n \"body\": \"test body\"\n }\n }\n }\n }\n }\n```\n\nUpdate a live activity\n\nTo update a live activity remotely using Firebase Cloud Messaging, you need to\nobtain a [push\ntoken](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Start-a-Live-Activity-that-supports-push-updates-to-push-tokens)\nfrom Apple. You will also need the [FCM registration\ntoken](/docs/cloud-messaging/ios/client#access_the_registration_token) for the\ntarget app.\n\nTo construct a [payload that updates a Live\nActivity](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Construct-the-ActivityKit-remote-push-notification-payload),\nfill in the\n[`apns.payload`](/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig) field\nfrom the following code sample to remotely update a live activity using\nFCM. You can use the [API\nExplorer](/docs/reference/fcm/rest/v1/projects.messages/send?apix=true&apix_params=%7B%22parent%22%3A%22projects%2F%3Cproject_number%3E%22%2C%22resource%22%3A%7B%22message%22%3A%7B%22token%22%3A%22%3Cfcm_token%3Atest%3E%22%2C%22apns%22%3A%7B%22live_activity_token%22%3A%22%3Clive_activity_push_token%3E%22%2C%22headers%22%3A%7B%22apns-priority%22%3A%2210%22%7D%2C%22payload%22%3A%7B%22aps%22%3A%7B%22timestamp%22%3A%22%3Ctimestamp%3E%22%2C%22event%22%3A%22update%22%2C%22content-state%22%3A%7B%22test1%22%3A100%2C%22test2%22%3A%22demo%22%7D%2C%22alert%22%3A%7B%22title%22%3A%22test%20title%22%2C%22body%22%3A%22test%20body%22%7D%7D%7D%7D%7D%7D%7D)\nto construct and test your payload. \n\n```gdscript\n\"message\":{\n \"token\": \"\u003cfcm_token:test\u003e\",\n \"apns\":{\n \"live_activity_token\": \"\u003clive_activity_push_token\u003e\",\n \"headers\":{\n \"apns-priority\": \"10\"\n },\n \"payload\":{\n \"aps\": {\n \"timestamp\": \u003ctimestamp\u003e,\n \"event\": \"update\",\n \"content-state\": {\n \"test1\": 100,\n \"test2\": \"demo\"\n },\n \"alert\": {\n \"title\": \"test title\",\n \"body\": \"test body\"\n }\n }\n }\n }\n }\n}\n```\n\nEnd a live activity\n\nTo end a live activity using Firebase Cloud Messaging, you need to obtain a [push\ntoken](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Start-a-Live-Activity-that-supports-push-updates-to-push-tokens)\nfrom Apple. You will also need the [FCM registration\ntoken](/docs/cloud-messaging/ios/client#access_the_registration_token)\nfor the target app.\n\nTo construct [a payload that ends a live\nactivity](https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications#Construct-the-ActivityKit-remote-push-notification-payload),\nfill in the\n[`apns.payload`](/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig) field\nfrom the following code sample to remotely end a live activity using\nFCM. You can use the [API\nExplorer](/docs/reference/fcm/rest/v1/projects.messages/send?apix=true&apix_params=%7B%22parent%22%3A%22projects%2F%3Cproject_number%3E%22%2C%22resource%22%3A%7B%22message%22%3A%7B%22token%22%3A%22%3Cfcm_token%3Atest%3E%22%2C%22apns%22%3A%7B%22live_activity_token%22%3A%22%3Clive_activity_push_token%3E%22%2C%22headers%22%3A%7B%22apns-priority%22%3A%2210%22%7D%2C%22payload%22%3A%7B%22aps%22%3A%7B%22timestamp%22%3A%22%3Ctimestamp%3E%22%2C%22dismissal-date%22%3A%22%3Cdismissal_date%3E%22%2C%22event%22%3A%22end%22%2C%22content-state%22%3A%7B%22test1%22%3A100%2C%22test2%22%3A%22demo%22%7D%2C%22alert%22%3A%7B%22title%22%3A%22test%20title%22%2C%22body%22%3A%22test%20body%22%7D%7D%7D%7D%7D%7D%7D)\nto construct and test your payload. \n\n```gdscript\n\"message\":{\n \"token\": \"\u003cfcm_token:test\u003e\",\n \"apns\":{\n \"live_activity_token\": \"\u003clive_activity_push_token\u003e\",\n \"headers\":{\n \"apns-priority\": \"10\"\n },\n \"payload\":{\n \"aps\": {\n \"timestamp\": \u003ctimestamp\u003e,\n \"dismissal-date\": \u003cdismissal_date\u003e,\n \"event\": \"end\",\n \"content-state\": {\n \"test1\": 100,\n \"test2\": \"demo\"\n },\n \"alert\": {\n \"title\": \"test title\",\n \"body\": \"test body\"\n }\n }\n }\n }\n }\n}\n```"]]