1 Reply
      Latest reply: Nov 29, 2016 3:21 PM by eskimo RSS
      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 (6,250 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"