iOS create a background service to send IP updates to server

Hi,


I am relatively new to iOS development, hence apologies if the question is too trivial.


I have a requirement wherein it is important for us to notify our server about a client's current IP address. The reason behind this is because our solution needs to know the current IP address of the registered device.


Now ideally we would want to create a service that can run in background (indefinitely), poll the ip Address of the device every 10 seconds, and if it sees that the ip has changed, then call a web service notifying the server about the same. I have the folowing questions based on my limited knowledge:


1). Apple gives us limited choices for apps that are allowed for running background threads (VoIP, background download, music playing, location updates etc.). Unfortunately my use case is not an exact fit for any of these. Can I still go ahead and somehow accomplish this?

2). I have read that iOScan close any background thread if it needs resources. Although my process is not resource intensive, should I be worried?

3). The background mode will only start once my app has been MANUALLY started. What I mean to say is that suppose I am able to run this in background, but for this to happen the user has to once start the app manually after restarting the device. Is there a way to start a service/thread on restart? Is there a workaround?


Any pointers in the right direction are much appreciated.


Thanks

Abhi

Replies

Discussion here: http://stackoverflow.com/questions/21807637/how-to-detect-device-ip-address-change-on-ios


...but I have doubts you can avoid protocol, especally with such frequent polling, if this app is meant for the store.

Now ideally we would want to create a service that can run in background (indefinitely), poll the ip Address of the device every 10 seconds, and if it sees that the ip has changed, then call a web service notifying the server about the same.

You are not going to be able to meet these requirements. iOS does not allow apps to resume in the background every 10 seconds. That’s not an arbitrary restriction; such an execution pattern would seriously compromise the device’s standby battery life. You will need to rethink how your app and server interact to track clients.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"