Can we access app when it is terminated/kill from background in ios 10.Actually i want to fetch lat long to hit the api when app is terminated from background.
Asked
Active
Viewed 137 times
-3
-
1Why would you want to do this? When a user closes an app running in the background, they want it to close. – Nick is tired Jul 24 '17 at 09:55
-
As my app contains the cards if the user fall in between 500mtr from the place of card then a notifications falls.So i want user app is in background or terminated from background location will update?? hope you understand my point. – rohit sandhu Jul 24 '17 at 10:06
-
@NickA he simply want to do this because he need to. For instance, need to update the app with a new data that the user might want to know about even if he accidently closed the app. – Curnelious Dec 01 '18 at 06:45
1 Answers
0
No. When the user terminates your app, the systems stops executing any code you were running in your app and you cannot manually restart your app.
The only way your app can be started after the user has killed it is by using the PushKit
framework and receiving a push notification from your server. See this answer. However, this framework was designed for VoIP applications and in your scenario the server doesn't know when to send the information, so even using PushKit
wouldn't solve your problem.

Dávid Pásztor
- 51,403
- 9
- 85
- 116