I am trying to start a live activity via push token with the below headers and payload. I am using the 'fetch-http2' npm module to execute the APNS request in a deno/typescript environment, and am authenticating via token/p8. The device receives the alert portion of the payload, but the live activity does not appear on the device. I get a 200 OK response from APNS with the unique ID, and dashboard shows notification was successfully sent to the device.
The odd thing, when backgrounding the app dismisses to the Dynamic Island with the animation as if there were a live activity happening, but there is not. When I check Activity<MyAttributes>.activities
on app launch, it's empty. I don't see any errors in Xcode when I have the app running/foregrounded when sending the request. Quitting the app restores normal behavior.
TL;DR:
I have regular APNS alert
push notification requests working without issue from the same environment. However when attempting to start a live activity via APNS, the alert is received but the live activity does not appear, despite the app/system seemingly thinking there is one. What could I be missing, or what else could I try?
I have checked that:
- My generated JWT and device token are valid according to CloudKit dashboard (again, standard push alerts are working as expected)
- I can successfully start a live activity locally/from foreground via
Activity.request
- I have added
Supports Live Activities
andSupports Live Activities Frequent Updates
to my app'sinfo.plist
, and also have the required capabilities enabled (remote push, background processing, background fetch) - I am using the current device
push-to-start token
(obtained from device viaActivity.pushToStartTokenUpdates
) for the device token in the APNS request (NOT the update token) - My
ActivityAttributes
andActivityAttributes.ContentState
values and types are correct
"headers": {
"authorization": "bearer {jwt}",
"apns-push-type": "liveactivity",
"apns-topic": "{bundleId}.push-type.liveactivity"
}
"aps": {
"attributes-type": "LiveActivityAttributes",
"attributes": {
"title": "Test Event"
},
"content-state": {
"status": 1
},
"event": "start",
"alert": {
"title": "Alert Title",
"body": "Live Activity has started."
},
"sound": "default",
"timestamp": Math.round(Date.now() / 1000)
}