I am trying to create an app with live activity showing when user enters and exit a region. I have location manager setup and region setup in my app. App sends local push notification when user enters and exits a region. I want to show live activity view with push notification when user enters region. I tried using 'didEnterRegion' delegate. But I am getting the error Error requesting Live Activity: The operation couldn’t be completed. Target is not foreground.. Is there any workaround for this?
Display ActivityKit Live Activity View using local push notifications when app is in the background
534 Views Asked by Faheem Rahman At
3
There are 3 best solutions below
0

Live activity can not start in application's background mode. apple_documentation kindly read this
0

This is not possible. A Live Activity can only be started when the app is in foreground based on documentation.
Your best bet is to send the notification, have the user open your app, and start the Live Activity.
Using actionable notification type can help you by guiding user for tap and hold it to add:
For remote push notifications, you need to prepare valid payload for this. More details about actionable notification from Apple documentation.