APNSwift icon indicating copy to clipboard operation
APNSwift copied to clipboard

iOS 16.1 Live Activity support added

Open nasircsms opened this issue 3 years ago • 3 comments

nasircsms avatar Sep 21 '22 04:09 nasircsms

Thank you for this, you are a legend!

How would I use the Activity's push token in the request's header? As described in the documentation:

To use remote push notifications to update your Live Activities, you need to use push tokens for authenticating with APNs as described in Establishing a Token-Based Connection to APNs.

When you’ve successfully started your Live Activity, you receive an Activity with a pushToken. Send it to your push notification server, and use it to send remote push notifications that update or end the Live Activity.

Send push notifications to the Live Activity using the push token you stored on your server. It’s essential that you set the fields for the content-state key to match your custom Activity.ContentState type to ensure the system can decode the JSON payload and update the Live Activity.

alex-de-waal avatar Sep 23 '22 04:09 alex-de-waal

The deviceToken param will contain Activity pushToken. There is no need to send it separately. So we'll be sending push notification using Activity pushToken and deviceToken won't be required in this case. I should have updated param name to reflect this.

nasircsms avatar Sep 23 '22 04:09 nasircsms

Awesome, that helps a lot! Thanks again dude

alex-de-waal avatar Sep 23 '22 04:09 alex-de-waal

@nasircsms planning on making these changes or should I take over?

kylebrowning avatar Oct 10 '22 15:10 kylebrowning

closing in favor of #164

kylebrowning avatar Oct 15 '22 15:10 kylebrowning