Geolocation not working when i was on/off internt on mobile


Hi all

Lot of Time what happening here on my customer side that when he/she start app he didnt confirm that internet is on . when he is login that time he know that net is off . and he start at the movement and he logged success. but that time he is not able to open geolocation. if he/she is login when net is already on he/she open gelocation. why can you please suggest me

Thanks in advance


Make sure you’re not indoors. Geolocation works only outdoors, otherwise you can use internet for accessing geolocation.


Thanks vahid

There is no issue about indoor and outdoor , i need call again this script when internet is on


So, you are not going to use x and y , and you need google map!

First of all, you can use ngCordova network plugin for checking the internet. You can be aware of connecting to the net by:

$rootScope.$on('$cordovaNetwork:online', function(event, networkState){})

Then, when it fired, you can load the script again by javascript. See here for more info.


Thanks a lot of Vahid
Excellent Solution and i got the Result