2 Replies Latest reply on Oct 5, 2016 2:58 AM by yogesh4643

    my Android App stopped detecting location using geolocation plugin

    sharathk61521583

      my Android App stopped detecting location using Geo location plugin.

       

      Plugin - <gap:plugin name="org.apache.cordova.geolocation" />

       

      The code works fine in browser but in android device it is not working.

       

      getDeviceCordinate:function(){

       

        navigator.geolocation.getCurrentPosition(position.onSuccess, position.onError);

        // navigator.geolocation.watchPosition(position.onSuccess, position.onError);

        },

        onSuccess:function(pos){

        position.lat = pos.coords.latitude;

        position.lng = pos.coords.longitude;

        alert(position.lat, position.lng);

        position.tim = pos.timestamp;

        position.status = "success";

        },

        onError:function(error){

        position.reset();

        position.status = "failure";

        position.error = error.code;

        position.errorcode = error.code;

        }

       

      Please Help me..