objective c - How to run repeated process while application is in background in iphone? -


continuously update timer that I have a function Apdetatatimr my application I want the process to continue The application is in the background, but that method is only being called when the application is in the foreground. Until the application is in the background, the phone is not being called. Below is the code for it. How can I fix this?

  dispatch_async (dispatch_get_global_queue DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {timer = [Anstimitr scheduled timer with time Intrrol: 1.0 target: self selector: @ selector (Update timer) user information: zero repeats: Yes ]; [[NSRON Loop CurrentRun Loop] Ad-Timer: Timer Format: NSDFastron Arrow LoopPoed]; [[NSRON loop currentRun loop] run;});    

Apple docs, only allowed to run in the background to these actions, and them from that each has its own limitations:

Audio "App" plays audio content to the user's background (this content includes streaming audio or video content using Airplay.)

The location "app" informs users about their location Even though it is running in the background.

VoIP-AAP provides the user the ability to make phone calls to use an Internet connection.

Newsstand Content - The App is a newsstand app that downloads and processes the magazine or newspaper content in the background.

The external accessory app works with a hardware assistant that needs to be updated on a regular basis through the external accessory framework.

The bluetooth-central app works with a Bluetooth Assistant which needs to be updated on a regular schedule via the Core Bluetooth framework.

Otherwise you can ask for 10 minutes. Additional runtime with this (Apple docs too)

  bgTask = [application Shurubakholdtskvith Akshapareshnhandlr: ^ {// marking Clear incomplete job business where you // Full Work finished or finished [App Endbacker Task: BGTs]; BgTask = UIBackgroundTaskInvalid; }]; // Start a long-running job and return immediately. Dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {// work associated with the work, preferably in chunks. [App Andbakgr Task: Bijitisk]; Bijitisk = UIBackgroundTaskInvalid;});   

: for more information

Comments