3 Replies
      Latest reply on Sep 20, 2018 11:40 PM by junkpile
      davealden Level 1 Level 1 (0 points)

        I’m currently working for a client who wishes their Cordova-based app to run indefinitely in the background on iOS. I explained to them that this is not possible, however they are insisting it is, on the basis of the documented claims of this Cordova plugin: https://github.com/transistorsoft/cordova-background-geolocation-lt


        Specifically, it claims:

        > [our] iOS [implementation] has a specialized config-option called preventSuspend: true. This mode will keep your iOS app running constantly in the background, 24/7.


        I’m unable see the source code of this plugin as to exactly how it achieves this because it’s bundled as a compiled framework, however the documentation implies it’s able to achieve this by leveraging the accelerometer/gyroscope APIs to monitor device movement while in the background, causing the application to be invoked very frequently, on each detection of a change in motion.


        I have tested this plugin within a test application, and it does indeed appear to keep the app constantly alive in the background (at least for my 30 minute test period).


        However, in my opinion, doing such a thing violates the app store review guidelines, specifically:


        > 2.5.4 Multitasking apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc. If your app uses location background mode, include a reminder that doing so may dramatically decrease battery life.


        My client is of the opinion that using this plugin is not in violation of app store guidelines given that, as well as the free open-source version, there is a commercial version for sale: http://www.transistorsoft.com/shop/products/cordova-background-geolocation


        So before I add this plugin to my client’s iOS app, only to have it rejected at the App Store review stage, I would like to ask some opinions regarding this.

        • Re: Constant background execution
          eskimo Apple Staff Apple Staff (13,895 points)

          I think you’re getting too focused on the how and are not looking enough at the why.  The key thing to consider here is the user-level benefit of running continuously in the background.  Certain groups of apps do this, and that’s fine.  Users expect turn-by-turn nav apps to drain their battery quickly, expect audio streaming apps to have measurable battery impact, and so on.  The background modes provided by iOS were designed to encapsulate user intent, and this is exactly what clause 2.5.4 is all about.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Constant background execution
              firesmg Level 1 Level 1 (0 points)

              I have a navigation type of app currently 'in review' in iTunesconnect.

              It is called Speedo Minder Pro Speed Alerts.

              We focus on the low level creeping speeders who need a persistent alert to slow them down; plus camera warnings.


              We have a licensed API from HERE.com for Speed Limits and Speed Cameras world wide.


              We have wanted 'run in background' from the outset but have never been able to get the app to run for more than about 10 minutes (anywhere other than 'in the foreground').

              This means that during a drive when the app is running and the phone calls comes through, if that call goes longer than 10 minutes the app stops.

              This is not what we or the users want.

              Can you offer a solution other than buying the http://www.transistorsoft.com/shop/products/cordova-background-geolocation





              Speedo Minder Pro Speed Alerts


                • Re: Constant background execution
                  junkpile Level 6 Level 6 (2,485 points)

                  If your app is using location updates, then it should run for more than 10 minutes in the background.


                  There’s no general purpose API to keep apps alive forever for arbitrary reasons, but for location tracking specifically, it should. With the usual caveats about explaining the consequences to your users.