I want to call api to update user location everytime(after every 1 min) when app is in background. I have enabled everything that is required for this but after 10-15 mins system kills my app. Is any solution to achieve this?
Call api when app is in background
Once an app is in the background, it will be suspended after a few seconds, and may be terminated at any point after that if and when the system needs resources. It is not possible to have an app run arbitrary code on a set timer, like every 1 minutes, including checking for location.
If I understand your use case correctly, you may want to look at the Significant Location Change API, which will send location updates to your app whether it is in the background, or after it has been terminated by the system. Although, the updates will be sent based on the motion of the device, but not on a set timer. There is no location API to send updates once every minute.
You can learn more about this API here: https://developer.apple.com/documentation/corelocation/getting_the_user_s_location/using_the_significant-change_location_service