Home > Mobile >  Ionic : GPS is not detect sometimes
Ionic : GPS is not detect sometimes

Time:12-30

I have one issue on my app. I have used GPS for getting lat and lon some times when clicking function GPS not detected app. So it's need to restart application. After restarting application GPS detected correctly. using ionic native with cordova GPS method(@ionic-native/location-accuracy). Do you have any idea please share with me.

Even when click function there is no GPS turn on screen too when this issue happening.

Please share the solution for above issue

CodePudding user response:

You may have to place it in the correct lifecycle method. Where do you have the method to get gps?

it needs to be after the component has be initialized:

ionViewDidEnter(){
   getLocation();
}

or

ngAfterViewInit(){
   getLocation();
}

CodePudding user response:

For me Even while I'm clicking manually this function not working

  • Related