views:

350

answers:

5

hi experts, is it any possibilities iphone app run on background, because my task is to retrieve wifi info and send it to the server about ssid & rssi, how this can be done,

thanks

+4  A: 

One of the limits imposed upon you with iPhone applications is that your application must run in the foreground. When the application is closed it will exit.

The only way around this is to provide a service on your website or something, effectively moving the application from the phone to another location while it is closed, and pushing notifications to the phone in the form of badges. This is very severe limitation for most applications, but it works quite well for others =)

Nippysaurus
Probably wont work for the proposed code in the question, as it seems they need the phone's wifi information, but this is a good idea for other applications. +1
Brandon Bodnár
+2  A: 

It can be done on jailbroken iphones, with backgrounder app. http://code.google.com/p/iphone-backgrounder/

You might also be able to hack it by sending push notifications and checking for wifi when responding to the notifications ... kind of server-to-phone polling.

I doubt apple would approve an app that did either of these though.

Matt Dotson
an iPhone app is not automatically loaded and run when a push notification is received, so that won't work
Philippe Leybaert
+2  A: 

If it's a possibility for you, jailbreaking the phone with either Pwnage Tool or blackra1n then installing Backgrounder via Cydia will allow you to run apps in the background. It's not difficult to jailbreak and backgrounding works very reliably.

carillonator
A: 

You can't run your apps in the background. I'd suggest getting a second iPhone.

Jessedc
A: 

I am looking for the method that make one application can run in the background without the application called backgrounder too.

This is not an answer.
Paul R