百度定位SDK for iOS v1.7 类参考
构造函数 | 所有成员列表
<BMKLocationManagerDelegate >协议 参考

BMKLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。 更多...

#import <BMKLocationManager.h>

类 <BMKLocationManagerDelegate > 继承关系图:

构造函数

(void) - BMKLocationManager:doRequestAlwaysAuthorization:
 为了适配app store关于新的后台定位的审核机制(app store要求如果开发者只配置了使用期间定位,则代码中不能出现申请后台定位的逻辑),当开发者在plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时,需要在该delegate中调用后台定位api:[locationManager requestAlwaysAuthorization]。开发者如果只配置了NSLocationWhenInUseUsageDescription,且只有使用期间的定位需求,则无需在delegate中实现逻辑。 更多...
 
(void) - BMKLocationManager:didFailWithError:
 当定位发生错误时,会调用代理的此方法。 更多...
 
(void) - BMKLocationManager:didUpdateLocation:orError:
 连续定位回调函数。 更多...
 
(void) - BMKLocationManager:didChangeAuthorizationStatus:
 定位权限状态改变时回调函数 更多...
 
(BOOL) - BMKLocationManagerShouldDisplayHeadingCalibration:
 该方法为BMKLocationManager提示需要设备校正回调方法。 更多...
 
(void) - BMKLocationManager:didUpdateHeading:
 该方法为BMKLocationManager提供设备朝向的回调方法。 更多...
 
(void) - BMKLocationManager:didUpdateNetworkState:orError:
 该方法为BMKLocationManager所在App系统网络状态改变的回调事件。 更多...
 

详细描述

BMKLocationManagerDelegate 协议定义了发生错误时的错误回调方法,连续定位的回调方法等。

函数文档

◆ BMKLocationManager:didChangeAuthorizationStatus:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
didChangeAuthorizationStatus: (CLAuthorizationStatus)  status 
optional

定位权限状态改变时回调函数

参数
manager定位 BMKLocationManager 类。
status定位权限状态。

◆ BMKLocationManager:didFailWithError:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
didFailWithError: (NSError *_Nullable)  error 
optional

当定位发生错误时,会调用代理的此方法。

参数
manager定位 BMKLocationManager 类。
error返回的错误,参考 CLError 。

◆ BMKLocationManager:didUpdateHeading:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
didUpdateHeading: (CLHeading *_Nullable)  heading 
optional

该方法为BMKLocationManager提供设备朝向的回调方法。

参数
manager提供该定位结果的BMKLocationManager类的实例
heading设备的朝向结果

◆ BMKLocationManager:didUpdateLocation:orError:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
didUpdateLocation: (BMKLocation *_Nullable)  location
orError: (NSError *_Nullable)  error 
optional

连续定位回调函数。

参数
manager定位 BMKLocationManager 类。
location定位结果,参考BMKLocation。
error错误信息。

◆ BMKLocationManager:didUpdateNetworkState:orError:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
didUpdateNetworkState: (BMKLocationNetworkState)  state
orError: (NSError *_Nullable)  error 
optional

该方法为BMKLocationManager所在App系统网络状态改变的回调事件。

参数
manager提供该定位结果的BMKLocationManager类的实例
state当前网络状态
error错误信息

◆ BMKLocationManager:doRequestAlwaysAuthorization:()

- (void BMKLocationManagerDelegate) BMKLocationManager: (BMKLocationManager *_Nonnull)  manager
doRequestAlwaysAuthorization: (CLLocationManager *_Nonnull)  locationManager 
optional

为了适配app store关于新的后台定位的审核机制(app store要求如果开发者只配置了使用期间定位,则代码中不能出现申请后台定位的逻辑),当开发者在plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时,需要在该delegate中调用后台定位api:[locationManager requestAlwaysAuthorization]。开发者如果只配置了NSLocationWhenInUseUsageDescription,且只有使用期间的定位需求,则无需在delegate中实现逻辑。

参数
manager定位 BMKLocationManager 类。
locationManager系统 CLLocationManager 类 。
自从
1.6.0

◆ BMKLocationManagerShouldDisplayHeadingCalibration:()

- (BOOL BMKLocationManagerDelegate) BMKLocationManagerShouldDisplayHeadingCalibration: (BMKLocationManager *_Nonnull)  manager
optional

该方法为BMKLocationManager提示需要设备校正回调方法。

参数
manager提供该定位结果的BMKLocationManager类的实例。

该协议的文档由以下文件生成: