Closed yetdog closed 1 year ago
I'm also wondering this. I think the Payload will need to be updated to support live activities https://github.com/edamov/pushok/blob/master/src/Payload.php#L33
{
"aps": {
"timestamp": 1168364460,
"event": "update",
"relevance-score": 75.0,
"stale-date": 1650998941,
"content-state": {
"driverName": "Anne Johnson",
"estimatedDeliveryTime": 1659416400
},
"alert": {
"title": "Delivery Update",
"body": "Your pizza order will arrive soon.",
"sound": "example.aiff"
}
}
}
You can see the payload keys have expanded to include support for live activities: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification#2943363
So I imagine the new Payload would look something like this:
Payload::create()
->setTimestamp(Carbon::now()->timestamp)
->setEvent('update')
->setRelevanceScore(75.0)
->setStaleDate(Carbon::now()->addMinutes(60)->timestamp)
->setContentState([
'driverName' => 'Anne Johnson',
'estimatedDeliveryTime' => Carbon::now()->addMinutes(5)->timestamp
])
->setAlert($alert);
Correct - I actually hacked this in myself, but mine is more primitive as I created a new class called ContentState - but manually added the field names as they align with my app. Im sure it can be written to be dynamic and definable in the script code, but I didn't go that far.
Hi there. Been using this library to great success the past few years - love it - thank you so much!
I was wondering if Live Activities were supported in the payload structure already, or if modifications are required?
thanks much!