admin管理员组

文章数量:1122832

Resorting to asking here since it seems that there's not a lot of documentation around debugging "Start" push notifications for Live Activities.

Basically, I've been trying to send a test "start" push notification from the Apple Push Notifications Console, and I am able to successfully send notifications where the console says "Received by APNS Server" and "Successfully delivered to the target device". However the problem is that the Live Activity never actually gets started.

I figured it could be an issue in the client code, and from my understanding, my didReceiveRemoteNotification function should run after it gets received. However, no logs from that function get run.

To further narrow down the issue, I then investigated in the console.app and under liveactivitiesd I noticed 2 errors: Incoming message does not contain usable attributes and Incoming message could not be parsed: <APSIncomingMessage: 0xXXXXXXXXX>

I know my ContentState matches the content state I send in the payload, so I'm not sure what else could be wrong for parsing.

Does anyone know what could be going on? Any help would be greatly appreciated!

Resorting to asking here since it seems that there's not a lot of documentation around debugging "Start" push notifications for Live Activities.

Basically, I've been trying to send a test "start" push notification from the Apple Push Notifications Console, and I am able to successfully send notifications where the console says "Received by APNS Server" and "Successfully delivered to the target device". However the problem is that the Live Activity never actually gets started.

I figured it could be an issue in the client code, and from my understanding, my didReceiveRemoteNotification function should run after it gets received. However, no logs from that function get run.

To further narrow down the issue, I then investigated in the console.app and under liveactivitiesd I noticed 2 errors: Incoming message does not contain usable attributes and Incoming message could not be parsed: <APSIncomingMessage: 0xXXXXXXXXX>

I know my ContentState matches the content state I send in the payload, so I'm not sure what else could be wrong for parsing.

Does anyone know what could be going on? Any help would be greatly appreciated!

Share Improve this question asked Dec 21, 2024 at 0:12 papers1010papers1010 451 gold badge1 silver badge11 bronze badges 2
  • Verify Notification Payload Structure by Correct Payload Format: The push notification payload should contain an aps dictionary with the usual fields (e.g., alert, content-available, etc.), but it should also include a Live Activity-specific key called activity that contains the type and the attributes required for thLive Activity. – K.pen Commented Dec 31, 2024 at 7:36
  • can you add the json or payload you have sent? – Maziar Saadatfar Commented Jan 4 at 8:46
Add a comment  | 

1 Answer 1

Reset to default 0

For future onlookers, I fixed this issue by adding in the attributes-type, attributes and alert fields as part of the aps dictionary.

It seemed redundant at first since all of those were part of my initial content-state field, but from this documentation, it seems this is necessary to specifically start a live activity

本文标签: