【问题标题】:ionic Native + geofance + iOS ERROR : "Location always permissions not granted"ionic Native + geofance + iOS 错误:“位置始终未授予权限”
【发布时间】:2017-11-16 11:31:40
【问题描述】:

请帮我解决这个错误。

ionic Native + geofance + iOS

我正在使用 ionic native 处理地理围栏,Android 地理围栏工作正常,但 iOS 给我错误错误:“位置始终未授予权限”

===========================================

this.geofence.initialize().then(data => {

      console.log('Geofence Plugin Ready');
         let fence = {
            id              : '69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb', //any unique ID
            latitude        : 21.08328129405459, //
            longitude       : 72.88010023534298, //
            radius          : 30, 
            transitionType  : 3, 
            notification    : { //notification settings
                                id              :  11212,//
                                title           : 'Insta Place',
                                text            : 'You are Near the Location.',
                                icon            : 'file://icon.png',
                                openAppOnClick  : true
                            }
          }
          // alert(JSON.stringify(fence));

          this.geofence.addOrUpdate(fence).then(
             (data) => console.log('Geofence added'),
             (err) => alert('Geofence failed to add Please Turn On your device location and try again.'+ err)
           );
        },err => {
           alert('Geofence Plugin Not Ready' + JSON.stringify(err));
        })

=============================

谢谢。

【问题讨论】:

    标签: ionic-framework ionic2 ionic3 ionic-native


    【解决方案1】:

    对我来说,解决方案是将以下隐私放入您的 .plist 文件中。

    NSLocationAlwaysAndWhenInUseUsageDescription 此应用需要持续访问您的位置才能跟踪您的位置,即使屏幕关闭或应用处于后台也是如此。

    谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-31
      • 2019-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-28
      • 1970-01-01
      • 2022-08-24
      相关资源
      最近更新 更多