admin管理员组文章数量:1394990
I am trying to integrate live activity into my React Native iOS app. I have made the UI, defined necessary attributes, and tested updating live activity using Apple Push Notification Console, which works fine. However, when sending the same payload via Firebase Cloud Messaging (FCM), the live activity does not update, even though FCM reports a successful send.
Below is the payload sent via FCM:
{
"message": {
"token": "{fcm token}",
"notification": {},
"apns": {
"headers": {
"apns-topic": "{app-bundle-id}.push-type.liveactivity",
"apns-push-type": "liveactivity",
"apns-priority": "10",
"apns-expiration": "0"
},
"payload": {
"aps": {
"timestamp": 1742974319,
"event": "update",
"content-state": {
"order_progress_info": "{\"title\":\"test\",\"subtitle\":\"subtitle\",\"timestamp\":\"1742974319924\"}"
}
}
},
"live_activity_token": "{live activity update token}"
}
}
}
I have confirmed:
- The same token works when sending from Apple Push Notification Console.
- Normal FCM alerts work fine.
- I have tried using
live_activity_token
at the outer level. - All required headers are included.
What could be wrong? Any help would be appreciated.
I am trying to integrate live activity into my React Native iOS app. I have made the UI, defined necessary attributes, and tested updating live activity using Apple Push Notification Console, which works fine. However, when sending the same payload via Firebase Cloud Messaging (FCM), the live activity does not update, even though FCM reports a successful send.
Below is the payload sent via FCM:
{
"message": {
"token": "{fcm token}",
"notification": {},
"apns": {
"headers": {
"apns-topic": "{app-bundle-id}.push-type.liveactivity",
"apns-push-type": "liveactivity",
"apns-priority": "10",
"apns-expiration": "0"
},
"payload": {
"aps": {
"timestamp": 1742974319,
"event": "update",
"content-state": {
"order_progress_info": "{\"title\":\"test\",\"subtitle\":\"subtitle\",\"timestamp\":\"1742974319924\"}"
}
}
},
"live_activity_token": "{live activity update token}"
}
}
}
I have confirmed:
- The same token works when sending from Apple Push Notification Console.
- Normal FCM alerts work fine.
- I have tried using
live_activity_token
at the outer level. - All required headers are included.
What could be wrong? Any help would be appreciated.
Share Improve this question edited Mar 27 at 7:52 Aviral Chauhan asked Mar 27 at 7:16 Aviral ChauhanAviral Chauhan 112 bronze badges1 Answer
Reset to default 0Try changing the timestamp to a future time, about 1 minute ahead. For example, if the current time is 11:58:11, set the timestamp to 11:59:11 (1743656351).
And you need to use the token from pushTokenUpdates to update live activity:
for await pushToken in activity.pushTokenUpdates { let token = pushToken.hexadecimalString }
本文标签: swiftUnable to update live activity in my iOS app from FCM (Firebase cloud messaging)Stack Overflow
版权声明:本文标题:swift - Unable to update live activity in my iOS app from FCM (Firebase cloud messaging) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744107027a2591110.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论