简体   繁体   中英

Can I send locations to a server in background on Iphone?

I'm looking for the answer to my question but it's quite difficult for me. I would like to keep connected to the server in background sending location of the iphone with ios4.

I`m really sad because I think that multitasking of apple is not real multitasking, in fact they only keep the state of the app but they don't allow it to run in background.

May be somebody knows if is possible to send a call by http every 30 or 60 minutes...

Please, any help would be very appreciated. Thanks in advance

Depends on it you are looking to track the user -- like Grindr does (this is not bad, per se, it just must be disclosed to the user -- and PLEASE remember to power down the GPS equipment if you really do not need to do this at certain times).

You are able to register for several different types of "location" registrations, wake up (enough to do something with that information) and wait until the next update.

Look at Multitasking under "Receiving Location Events in the Background". It will give you all the info you need. Short answer: iOS4 may not support what you think you need for this, but it, in fact, does support everything required to do what you are asking.

link text (Membership required)

I know this is an old question, but below is a relevant statement from the Core Location documentation regarding background handling of "significant location change":

Because your application is in the background, it should do minimal work and avoid any tasks (such as querying the network) that might prevent it from returning before the allocated time expires. If it does not, your application may be terminated.

link to documentation containing quote


I'm not sure if the quoted statement is saying to avoid all network "queries", but I think a quick POST of the location should be fine.

There's a good answer to this question by user RedBlueThing here . The answer is basically yes, you can process network requests, but you might need to ask the OS for more time to accomplish the task.

I did this but my app got rejected due to this last week. I used the ios5 SDK.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM