高德地图SDK(定位)  V2.12.2
<AMapGeoFenceManagerDelegate> Protocol Reference

#import <AMapGeoFenceManager.h>

Inheritance diagram for <AMapGeoFenceManagerDelegate>:

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...
 

Detailed Description

地理围栏代理协议(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.

Method Documentation

◆ amapGeoFenceManager:didAddRegionForMonitoringFinished:customID:error:

- (void) amapGeoFenceManager: (AMapGeoFenceManager *)  manager
didAddRegionForMonitoringFinished: (NSArray< AMapGeoFenceRegion * > *)  regions
customID: (NSString *)  customID
error: (NSError *)  error 
optional

添加地理围栏完成后的回调,成功与失败都会调用 Callback after adding a geofence, will be called whether successful or failed

Parameters
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

◆ amapGeoFenceManager:didGeoFencesStatusChangedForRegion:customID:error:

- (void) amapGeoFenceManager: (AMapGeoFenceManager *)  manager
didGeoFencesStatusChangedForRegion: (AMapGeoFenceRegion *)  region
customID: (NSString *)  customID
error: (NSError *)  error 
optional

地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用 Callback when geofence status changes. It will be triggered when the fence status value changes or positioning fails.

Parameters
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

◆ amapGeoFenceManager:doRequireLocationAuth:

- (void) amapGeoFenceManager: (AMapGeoFenceManager *)  manager
doRequireLocationAuth: (CLLocationManager *)  locationManager 
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)

Parameters
manager地理围栏管理类。Geofence management category.
locationManager需要申请后台定位权限的locationManager。 The locationManager that needs to request background location permission.
Since
2.6.2

◆ amapLocationManager:doRequireTemporaryFullAccuracyAuth:completion:

- (void) amapLocationManager: (AMapGeoFenceManager *)  manager
doRequireTemporaryFullAccuracyAuth: (CLLocationManager *)  locationManager
completion: (void(^)(NSError *error))  completion 
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)

Parameters
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.
Since
2.6.7

The documentation for this protocol was generated from the following file:
© 2017 高德信息技术有限公司 版权所有,保留所有权利。