ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.06k forks source link

geolocation is not working in android mobile #1448

Open lovepreetsingh03 opened 6 years ago

lovepreetsingh03 commented 6 years ago

I get location in my mobile ( yuforia 5010A ) but When I install app in my friend mobile then its not working. i didn't understand why its not working in other mobile. below is my code .

let enableOption={ timeout: 10000, enableHighAccuracy:true }; this.loact.canRequest().then((res: boolean)=>{ if(res) { this.loact.request(this.loact.REQUEST_PRIORITY_HIGH_ACCURACY).then(() =>{

         this.geolocation.getCurrentPosition(enableOption).then((position) => {
           this.geoCuntory(position);
            }).catch((error) => {
              alert(error);

            });

      }, (error)=>{
         alert(error);

      }
    )
    }
  })

Please help me out to get solution