Can it possible to run a thread in iOS application that is running on background to send location when push notification is received?
Asked
Active
Viewed 549 times
1 Answers
0
From Apple Push docs:
The operating system receives a push notification on behalf of the application and alerts the user. Once alerted, users may choose to launch the application, which then downloads the data from its provider. If an application is running when a notification comes in, the application can choose to handle the notification directly.
When the app is running in the foreground is the only time it can respond directly to a push notification. The OS is handling the push, displaying it, and queuing it for later user action.
iOS applications can't continuously run in the background, only for a few minutes after the app is closed (to finish a task if memory allows, for something like uploading a photo).

Steven Stefanik
- 486
- 3
- 9
-
So how navigation applicatiions works? without running on backround? – uriel Jan 24 '12 at 22:48
-
What navigation app are you referring to? – Steven Stefanik Jan 24 '12 at 22:54
-
Check out this doc [Implementing Long-Running Background Tasks](http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3) I don't know what you're trying to do with your app, but you may be able to wake your app up and perform a function when the location changes. Maybe that solves your problem better than trying to act on push notifications. – Steven Stefanik Jan 25 '12 at 15:19
-
I don't want to trigger GPS location by user position, but to be able to get user location when my server is asking. can I do that on iphone or not? – uriel Jan 25 '12 at 15:45
-
I do not think so. But consider my suggestion. What is the difference between executing code on a location change vs pushing to ask the location? The server still gets the location it needs. – Steven Stefanik Jan 25 '12 at 17:31