Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Geolocation not working on Android (works on iOS)

$
0
0

@Li_eric wrote:

import { Geolocation } from '@ionic-native/geolocation';
constructor(public geolocation: Geolocation){}

getCoords(){
  this.geolocation.getCurrentPosition().then((result) => {
               if (result != null) {
                 this.obPoint.longitude = result.coords.longitude;
                 this.obPoint.latitude = result.coords.latitude;
                 console.log(result);
               }
               this.refreshData();
            }).catch(err=>{
              console.log(err);
            });
}

I am running Android version 7
I have tried changing the options, but it still does not work.
My manifest file is also correct.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>