Geolocalization on ios not working

Hi all,
I integrated ionic geolocation plugin on my ionic 5 app but on ios simulator it doesn’t work. Could you please support me?

npm install cordova-plugin-geolocation
npm install @ionic-native/geolocation
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
   <string>We use your location for full functionality of certain app features.</string>
</edit-config>
import { Geolocation } from '@ionic-native/geolocation/ngx';

...

constructor(private geolocation: Geolocation) {}

...

this.geolocation.getCurrentPosition().then((resp) => {
 // resp.coords.latitude
 // resp.coords.longitude
}).catch((error) => {
  console.log('Error getting location', error);
});

let watch = this.geolocation.watchPosition();
watch.subscribe((data) => {
 // data can be a set of coordinates, or an error (if an error occurred).
 // data.coords.latitude
 // data.coords.longitude
});

On browser and on android it works. On ios simulator or device, no permission request shown and geolocalizator not works.

Any idea?

Tks

Hi,

I am using almost the same code, and didn’t experienced any misbeheviour.

corrected:
try to use the capacitor instead of cordova plugin…I am going to check my code in the afternoon.

However on my girlfriend’s android phone even didn’t ask for the permission. The best thing would be really to try on an IOS with default settings.

Check this out:

they are online and cool company, lot’s of IOS simulator for a little money.

I don’t know how critical for you the exact postion, but you can also go for :slight_smile: https://ipstack.com/

This is really cool., you even don’t ask for the persmission. but you know where is the user.

Csaba