How to check Gps location enabled or disabled in ios?


#1

to write my gps location enabled or disabled in android code below:
if (this.platform.is(‘android’)) {
let successCallback = (isAvailable) => { console.log('Is available? ’ + isAvailable); };
let errorCallback = (e) => console.error(e);

  this.diagnostic.isLocationAvailable().then(successCallback).catch(errorCallback);

  this.diagnostic.isGpsLocationAvailable().then(successCallback, errorCallback);


  this.diagnostic.getLocationMode()
    .then((state) => {
      if (state == this.diagnostic.locationMode.LOCATION_OFF) {
        let confirm = this.alertCtrl.create({
          title: '<b>Location</b>',
          message: 'Location information is unavaliable on this device. Go to Settings to enable Location for Untapped.',
          buttons: [

            {
              text: 'GO TO SETTINGS',
              handler: () => {
                this.diagnostic.switchToLocationSettings();

              }
            }
          ]
        });
        confirm.present();
      } else {


        this.FinalSave();
      }
    }).catch(e => console.error(e));
}

how to write ios gps location checking code?

please help me?