|
高德地图SDK(定位)
V2.12.2
|
#import <AMapGeoFenceManager.h>
Instance Methods | |
| (void) | - amapLocationManager:doRequireTemporaryFullAccuracyAuth:completion: |
| iOS14及以上版本使用地理围栏功能,需要在plist中配置NSLocationTemporaryUsageDescriptionDictionary字典描述,且添加自定义Key描述地理围栏的使用场景,此描述会在申请临时精确定位权限的弹窗中展示。该回调触发条件:拥有定位权限,但是没有获得精确定位权限的情况下,会触发该回调。此方法实现调用申请临时精确定位权限API即可: IOS 14 and above versions use geofencing functionality, which requires configuring the NSLocator Temporary Usage Description Dictionary dictionary in plist and adding a custom Key to describe the usage scenario of geofencing. This description will be displayed in the pop-up window for applying for temporary precise positioning permission. The trigger condition for this callback is that it will be triggered if the user has location permission but has not obtained precise location permission. This method can be used to call the temporary precise positioning permission API for application: [locationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:"PurposeKey" completion:^(NSError *error){ if(completion){ completion(error); } }]; (必须调用,不然无法正常获取临时精确定位权限) (Must be called, otherwise temporary precise location permission cannot be obtained normally) More... | |
| (void) | - amapGeoFenceManager:doRequireLocationAuth: |
| 当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription,并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,会调用代理的此方法。 此方法实现申请后台权限API即可:[locationManager requestAlwaysAuthorization](必须调用,不然无法正常获取定位权限) When NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription is configured in the plist,and [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,This method of the delegate will be called.This method only needs to implement the API for requesting background permission:[locationManager requestAlwaysAuthorization](Must be called, otherwise location permission cannot be obtained normally) More... | |
| (void) | - amapGeoFenceManager:didAddRegionForMonitoringFinished:customID:error: |
| 添加地理围栏完成后的回调,成功与失败都会调用 Callback after adding a geofence, will be called whether successful or failed More... | |
| (void) | - amapGeoFenceManager:didGeoFencesStatusChangedForRegion:customID:error: |
| 地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用 Callback when geofence status changes. It will be triggered when the fence status value changes or positioning fails. More... | |
地理围栏代理协议(since 2.3.0),该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。 Geo-fencing Agent Protocol (since 2.3.0), this protocol defines the callback methods related to geo-fencing, including addition, status change, etc.
|
optional |
添加地理围栏完成后的回调,成功与失败都会调用 Callback after adding a geofence, will be called whether successful or failed
| manager | 地理围栏管理类 Geofence Management Category |
| regions | 成功添加的一个或多个地理围栏构成的数组 An array of one or more successfully added geofences |
| customID | 用户执行添加围栏函数时传入的customID The customID passed in when the user executes the add geofence function |
| error | 添加失败的错误信息 Error message for failed addition |
|
optional |
地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用 Callback when geofence status changes. It will be triggered when the fence status value changes or positioning fails.
| manager | 地理围栏管理类 Geofence Management Category |
| region | 状态改变的地理围栏 State-changed geofence |
| customID | 用户执行添加围栏函数时传入的customID The customID passed in when the user executes the add geofence function |
| error | 错误信息,如定位相关的错误 Error information, such as location-related errors |
|
optional |
当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription,并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,会调用代理的此方法。 此方法实现申请后台权限API即可:[locationManager requestAlwaysAuthorization](必须调用,不然无法正常获取定位权限) When NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription is configured in the plist,and [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined,This method of the delegate will be called.This method only needs to implement the API for requesting background permission:[locationManager requestAlwaysAuthorization](Must be called, otherwise location permission cannot be obtained normally)
| manager | 地理围栏管理类。Geofence management category. |
| locationManager | 需要申请后台定位权限的locationManager。 The locationManager that needs to request background location permission. |
|
required |
iOS14及以上版本使用地理围栏功能,需要在plist中配置NSLocationTemporaryUsageDescriptionDictionary字典描述,且添加自定义Key描述地理围栏的使用场景,此描述会在申请临时精确定位权限的弹窗中展示。该回调触发条件:拥有定位权限,但是没有获得精确定位权限的情况下,会触发该回调。此方法实现调用申请临时精确定位权限API即可: IOS 14 and above versions use geofencing functionality, which requires configuring the NSLocator Temporary Usage Description Dictionary dictionary in plist and adding a custom Key to describe the usage scenario of geofencing. This description will be displayed in the pop-up window for applying for temporary precise positioning permission. The trigger condition for this callback is that it will be triggered if the user has location permission but has not obtained precise location permission. This method can be used to call the temporary precise positioning permission API for application: [locationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:"PurposeKey" completion:^(NSError *error){ if(completion){ completion(error); } }]; (必须调用,不然无法正常获取临时精确定位权限) (Must be called, otherwise temporary precise location permission cannot be obtained normally)
| manager | 地理围栏管理类。 manager Geofence management class. |
| locationManager | 需要申请临时精确定位权限的locationManager。locationManager The locationManager that needs to request temporary precise location permission. |
| completion | 临时精确定位权限API回调结果。直接返回系统error即可 completion temporary precise location permission API callback result. Directly return the system error. |