Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove or end Live activity from Lock Screen using push notification when app is in kill mode in iOS [closed]

Tags:

ios

swift

swiftui

"event: update" works perfectly fine.

"event: end" not working nothing happens, only state data modified, live activity popup not removed from lock screen.

{ "aps": { "timestamp": 1168364460, "event": "end", "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" } } }

like image 231
Dhruvin Thumar Avatar asked Dec 16 '25 12:12

Dhruvin Thumar


1 Answers

According to the documentation there is a dismissal-date entry in the aps dictionary of your JSON payload. Setting this to a date (timestamp?) in the past will dismiss immediately.

like image 80
Geoff Hackworth Avatar answered Dec 19 '25 02:12

Geoff Hackworth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!