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


#1

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


#2

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


#3

Thanks vahid

There is no issue about indoor and outdoor , i need call again this script when internet is on
src=“http://maps.google.com/maps/api/js?key=AIzaSyDMfntppUYmjG2Rnsa-kuH67QV2ZfJN2Tg&sensor=false&v=3&libraries=geometry”>


#4

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.


#5

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