Pergunta

When iPhone app is in background state or when app is minimized, I want to monitor the duration of time the app is in background and on every regular interval like every 24hrs need to get updates from web server and write the modifications in my local database.

This monitor cycle will repeat as long as app is in background. Is this kind of task is possible in iPhone applications ? Could any body help me how can I perform these tasks when app is in background state ?

beginBackgroundTaskWithExpirationHandler: is the API to make the app in background for long tasks but how long will this support.

Foi útil?

Solução

Background tasks are killed after 10 minutes time, so to answer your question: No, it's not without faking some kind of long term event handling through a significant location's update, and even then, you have no control over when exactly the events are sent. On the other hand, using APNS to alert the user to a change has the possibility of being ignored, but comes with regularity.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top