4 Replies
      Latest reply: Sep 21, 2016 4:12 AM by Infotrack RSS
      Infotrack Level 1 Level 1 (0 points)

        Hi,

         

        I need to run the application to get the location and to send it to the server every 5 mniutes. Need to do this even after user force quit the appliaction.

         

        How to get the location continuously in the background, and how to send it to the server every 5 minutes even after terminate the application.

         

        Note: I am working on location related application.

         

        Please let me know is it possible to do the above.

         

        Thanks in advance

        • Re: Relaunch the terminated application to get the location
          eskimo Apple Staff Apple Staff (6,470 points)

          It’s not possible to meet these requirements on iOS.  See this thread for more context.

          Share and Enjoy

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

            • Re: Relaunch the terminated application to get the location
              Infotrack Level 1 Level 1 (0 points)

              Hi eskimo,

              what if i use Significant location changes in google maps, will it triggers the terminated application?

               

              From the thread you reffered:

               

              Even if you ignore the above, iOS does not provide a general way for apps to run periodically in the background.  "There are specific mechanism that do allow you to run in the background", but no general purpose way to get background execution time every N minutes.

               

              In your thread you have mentioned that "There are specific mechanism that do allow you to run in the background".


              can you give me a references for this if any??

               

              Thanks in advance.

                • Re: Relaunch the terminated application to get the location
                  eskimo Apple Staff Apple Staff (6,470 points)

                  what if i use Significant location changes in google maps, will it triggers the terminated application?

                  I honestly don’t remember which of the launch-in-the-background technologies currently launch an app that’s been terminated by the user.  The exact list has changed a bunch of times over the years.

                  Regardless, significant location change won’t help you meet your requirement because you can’t guarantee that the user will move their device regularly.

                  In your thread you have mentioned that "There are specific mechanism that do allow you to run in the background".

                  These are the UIBackgroundModes discussed in App Programming Guide for iOS.  Keep in mind that each of these is intended for some specific user-level functionality, which means that:

                  • they aren’t really suitable for your general requirements (there are edge cases that makes sense in the context for which they were intended to be used but will cause problems in the general case)

                  • App Review looks at their use carefully (per clause 2.5.4 of the App Store Review Guidelines)

                  Share and Enjoy

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