Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3337] Need to run the background services to get user current location on every 1 minute interval, which stops after 2-3 minutes of app being in background state.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2016-03-10T18:37:18.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsbackgroundservice, ios
Reporterjithesh shetty
AssigneeIngo Muschenetz
Created2016-01-12T11:45:39.000+0000
Updated2016-11-05T19:46:12.000+0000

Description

I am developing an app in IOS, which have a background service to send the current position of the user to server using web API. the issue i am facing is when the app is minimised(paused), the background service will stop after 3 minutes. The code for this is given in the following link. Please download the files. I have contacted the support team, they suggested to create a ticket here. https://www.dropbox.com/s/cjenlydiwpzsapk/backgroundService.zip?dl=0 Same file has been attahced below. please advise on this as HIGH priority as the app is not going to stores without this feature. Thanks and Regards, Jithesh

Attachments

FileDateSize
app.js2016-01-12T11:44:03.000+00001472
test - Copy.js2016-01-12T11:44:03.000+0000176

Comments

  1. Sharif AbuDarda 2016-01-13

    Hello, Here are some Background Service Limitations which you should know. A background service is subject to limitations imposed by the operating system, such as 1. The OS limits the total amount of time a background service can run for after the application is paused, typically to no more than 10 minutes. 2. The OS may terminate the background service at any point to reclaim resources. So, For your case, the device OS is stopping the backgroung service early to reclaim resources. Maybe because your device has low memory. We tried in our device and in simulator. For simulator we are able to run more than 8 minutes. And in device we were able to run 3 minutes. This is iOS device feature. Appcelerator can't do anything about it. Now here are some important link on the issue in the web. 1. http://stackoverflow.com/questions/11417837/running-background-services-in-ios 2. https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html Hope this helps, Thanks.
  2. Sebastian Klaus 2016-01-14

    What can we do to let some things happen in background? An interval without a backgroundservice?
  3. jithesh shetty 2016-01-14

    Is there any other way to send userlocation ,when the app runs in background continuosly ?? if any please help us out as soon as possible
  4. Sebastian Klaus 2016-01-14

    Have you tried an interval without the backgroundservice?
  5. jithesh shetty 2016-01-18

    Yess,I tried using interval without background service too, no improvement
  6. Sharif AbuDarda 2016-03-08

    Hello, Can you follow this link http://docs.appcelerator.com/platform/latest/#!/guide/tiapp.xml_and_timodule.xml_Reference-section-29004921_tiapp.xmlandtimodule.xmlReference-UIBackgroundModes Which demonstrate some UIBackgroundModes for a BackgroundService to run for more than a limited period of time, the application must declare one or more of these background modes. For example in your app you will need to enable location background modes.
       <ios>
       <plist>
       <dict>
       <key>UIBackgroundModes</key>
       <array>
       <string>location</string>
       </array>
       </dict>
       </plist>
       </ios>
       
    Please try it and let us know the response. Thanks.
  7. Rainer Schleevoigt 2016-11-05

    Hi, I need a solution for an enterprise app (no revision) I have put a infinite loop of sound playing, but the service will killed after a couple of minutes. On simulator it runs a couple of hours. But on device only very short. How ca I achieve an invinity runtime. The client want to sync DB after getting online connection. Thanx

JSON Source