1 Reply Latest reply on Mar 21, 2017 9:52 AM by audreyeso

    geolocation query

    sabapathis87814493

      I am working on an app which needs an device latitude and longitude values.

      I am going through some problems here to access it.

       

      I have below questions and desperate to find an answer:

       

      I need to access Latitude and Longitude immediately by calling getCurrentPosition()? actually it is delaying since it is a async js function

       

      First,  i am calling navigator.geolocation.getCurrentPosition with setInterval (12000). and i have given timeout for navigator.geolocation.getCurrentPosition (timeout: 10000, and enableHighAccuracy: true);

       

      1) IOS

           With this,  i accessed from phonegap developer app

                1) i open the app with location on, i could access the geolocation and i could fetch it in every time interval(12,000)

                2) Then i switched off location, then as expected i couldn't access location on every interval.

           But when i tested above steps by converting as an app

                it always tells me that "location access has timed out"

       

      2) Android

           In both cases, it always showing me "Location access timed out".

         

      Please help me sort out this

        • 1. Re: geolocation query
          audreyeso Adobe Employee

          Hi! Here are some suggestions!

           

          1. Have you tried rebooting the devices? You can also try to set a longer timeout in location options. Geolocation can time out also if mobile data is turned off. 

           

          2. Did you activate the "Use Networks" option?

          Go to Settings -> Location and security -> Use networks; and activate it.

           

          3. Make sure that your android permissions are set for location.

           

          Let me know if any of that helps!