TencentLBSLocationManager Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | TencentLBSLocationManager.h |
apiKey
API Key, 在使用定位SDK服务之前需要先绑定key。
@property (nonatomic, copy) NSString *apiKeyDiscussion
API Key, 在使用定位SDK服务之前需要先绑定key。
Declared In
TencentLBSLocationManager.h
accuracyAuthorization
当前位置管理器定位精度的授权状态
@property (nonatomic, readonly) TencentLBSAccuracyAuthorization accuracyAuthorizationDiscussion
当前位置管理器定位精度的授权状态
Declared In
TencentLBSLocationManager.h
authorizationStatus
当前位置管理器定位权限的授权状态
@property (nonatomic, readonly) CLAuthorizationStatus authorizationStatusDiscussion
当前位置管理器定位权限的授权状态
Declared In
TencentLBSLocationManager.h
delegate
实现了 TencentLBSLocationManagerDelegate 协议的类指针。
@property (nonatomic, weak) id<TencentLBSLocationManagerDelegate> delegateDiscussion
实现了 TencentLBSLocationManagerDelegate 协议的类指针。
Declared In
TencentLBSLocationManager.h
distanceFilter
设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
@property (nonatomic, assign) CLLocationDistance distanceFilterDiscussion
设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
Declared In
TencentLBSLocationManager.h
desiredAccuracy
设定定位精度。默认为 kCLLocationAccuracyBest 。
@property (nonatomic, assign) CLLocationAccuracy desiredAccuracyDiscussion
设定定位精度。默认为 kCLLocationAccuracyBest 。
Declared In
TencentLBSLocationManager.h
pausesLocationUpdatesAutomatically
指定定位是否会被系统自动暂停。默认为 YES 。
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomaticallyDiscussion
指定定位是否会被系统自动暂停。默认为 YES 。
Declared In
TencentLBSLocationManager.h
allowsBackgroundLocationUpdates
是否允许后台定位。默认为 NO。 iOS 9.0 以上用户需要设置该选项并且在info.list里面Background Modes 中的 Location updates 处于选中状态才可以使用后台定位权限。iOS 9.0之前可以直接申请总是使用的权限来获得后台定位。
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdatesDiscussion
是否允许后台定位。默认为 NO。 iOS 9.0 以上用户需要设置该选项并且在info.list里面Background Modes 中的 Location updates 处于选中状态才可以使用后台定位权限。iOS 9.0之前可以直接申请总是使用的权限来获得后台定位。
设置为 YES 的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
Declared In
TencentLBSLocationManager.h
activityType
用户的活动类型
@property (nonatomic, assign) CLActivityType activityTypeDiscussion
用户的活动类型
设置用户的活动类型。默认值为 CLActivityTypeOther
Declared In
TencentLBSLocationManager.h
headingFilter
设置当朝向改变时,每隔多少度调用一次 只有当设备方向的改变值超过该属性值时才激发delegate的方法。
@property (nonatomic, assign) CLLocationDegrees headingFilterDiscussion
设置当朝向改变时,每隔多少度调用一次 只有当设备方向的改变值超过该属性值时才激发delegate的方法。
Declared In
TencentLBSLocationManager.h
headingOrientation
设置设备当前的朝向
@property (nonatomic, assign) CLDeviceOrientation headingOrientationDiscussion
设置设备当前的朝向
Declared In
TencentLBSLocationManager.h
requestLevel
连续定位的逆地理信息请求的Level。默认为TencentLBSRequestLevelGeo
@property (nonatomic, assign) TencentLBSRequestLevel requestLevelDiscussion
连续定位的逆地理信息请求的Level。默认为TencentLBSRequestLevelGeo
Declared In
TencentLBSLocationManager.h
coordinateType
返回的TencentLBSLocation的location字段的坐标类型。默认为TencentLBSLocationCoordinateTypeGCJ02。
@property (nonatomic, assign) TencentLBSLocationCoordinateType coordinateTypeDiscussion
返回的TencentLBSLocation的location字段的坐标类型。默认为TencentLBSLocationCoordinateTypeGCJ02。
在一次定位过程中,只允许设置一次,不允许重复设置
Declared In
TencentLBSLocationManager.h
poiUpdateInterval
指定POI的更新间隔。 默认是10s
@property (nonatomic, assign) NSInteger poiUpdateIntervalDiscussion
指定POI的更新间隔。 默认是10s
Declared In
TencentLBSLocationManager.h
enableAntiMockLocation
是否允许开启反作弊检查
@property (nonatomic, assign) BOOL enableAntiMockLocationDiscussion
是否允许开启反作弊检查
Declared In
TencentLBSLocationManager.h
locationCallbackInterval
连续定位时, 回调的间隔. 默认: 0, 单位: 毫秒 连续定位, 且间隔 大于 0 时, 才有效
@property (nonatomic, assign) uint64_t locationCallbackIntervalDiscussion
连续定位时, 回调的间隔. 默认: 0, 单位: 毫秒 连续定位, 且间隔 大于 0 时, 才有效
Declared In
TencentLBSLocationManager.h
+ getLBSSDKVersion
获取定位SDK的版本
+ (NSString *)getLBSSDKVersionDiscussion
获取定位SDK的版本
Declared In
TencentLBSLocationManager.h
+ getLBSSDKbuild
获取定位SDK的构建日期
+ (NSString *)getLBSSDKbuildDiscussion
获取定位SDK的构建日期
Declared In
TencentLBSLocationManager.h
– setDeviceId:
设置id给定位SDK @param deviceid
- (void)setDeviceId:(NSString *)deviceidDiscussion
设置id给定位SDK @param deviceid
Declared In
TencentLBSLocationManager.h
– setDataWithValue:forKey:
向SDK内部设置数据,以满足定制的需求 @param value @param key
- (void)setDataWithValue:(NSString *)value forKey:(NSString *)keyDiscussion
向SDK内部设置数据,以满足定制的需求 @param value @param key
Declared In
TencentLBSLocationManager.h
+ setUserAgreePrivacy:
设置用户是否同意隐私协议政策
调用其他接口前必须首先调用此接口进行用户是否同意隐私政策的设置,传入YES后才能正常使用定位功能,否则TencentLBSLocationManager初始化不成功,返回nil,定位功能均无法使用
+ (void)setUserAgreePrivacy:(BOOL)isAgreeParameters
isAgree |
是否同意隐私政策 |
|---|
Discussion
设置用户是否同意隐私协议政策
调用其他接口前必须首先调用此接口进行用户是否同意隐私政策的设置,传入YES后才能正常使用定位功能,否则TencentLBSLocationManager初始化不成功,返回nil,定位功能均无法使用
Declared In
TencentLBSLocationManager.h
+ getUserAgreePrivacy
获取用户是否同意隐私政策协议
设置用户隐私后,可通过该接口判断用户隐私状态
+ (BOOL)getUserAgreePrivacyReturn Value
isAgreePrivacy 是否同意隐私政策
Discussion
获取用户是否同意隐私政策协议
设置用户隐私后,可通过该接口判断用户隐私状态
Declared In
TencentLBSLocationManager.h
– requestTemporaryFullAccuracyAuthorizationWithPurposeKey:
当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString *)purposeKeyParameters
purposeKey |
需要在info.plist中配置NSLocationTemporaryUsageDescriptionDictionary key值和对应的申请该权限的描述理由 |
|---|
Discussion
当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
Declared In
TencentLBSLocationManager.h
– requestTemporaryFullAccuracyAuthorizationWithPurposeKey:completion:
当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
- (void)requestTemporaryFullAccuracyAuthorizationWithPurposeKey:(NSString *)purposeKey completion:(void ( ^ ) ( NSError *))completionParameters
purposeKey |
需要在info.plist中配置NSLocationTemporaryUsageDescriptionDictionary key值和对应的申请该权限的描述理由 |
|---|---|
completion |
在弹框让用户选择后的用户的反馈,如果用户授予该权限,block中的参数为nil,如果未授予,block中的参数将为PurposeKey对于的key的描述(如PurposeKey=TemporaryPurposKey_1) |
Discussion
当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
Declared In
TencentLBSLocationManager.h
+ accuracyAuthorization
accuracyAuthorization
+ (TencentLBSAccuracyAuthorization)accuracyAuthorizationDiscussion
accuracyAuthorization
Discussion: Return the current TencentLBSAccuracyAuthorization of the calling application.
Declared In
TencentLBSLocationManager.h
– requestLocationWithCompletionBlock:
单次定位
- (BOOL)requestLocationWithCompletionBlock:(TencentLBSLocatingCompletionBlock)completionBlockDiscussion
单次定位
该方法为下面方法的一层封装。 level默认是TencentLBSRequestLevelPoi timeout默认是10s
Declared In
TencentLBSLocationManager.h
– requestLocationWithRequestLevel:locationTimeout:completionBlock:
单次定位
- (BOOL)requestLocationWithRequestLevel:(TencentLBSRequestLevel)level locationTimeout:(NSTimeInterval)timeout completionBlock:(TencentLBSLocatingCompletionBlock)completionBlockParameters
level |
可以根据此参数来对应的获取POI信息 |
|---|---|
timeout |
表示获取POI的超时时间。 |
completionBlock |
单次定位完成后的Block |
Discussion
单次定位
注意:不能连续调用该接口,需在上一次返回之后才能再次发起调用。该接口兼容iOS 7.0及以上,因iOS 9.0系统提供单次定位能力,故在9.0以上会调用系统单次定位接口,9.0之前SDK完成封装。可以通过调用cancelRequestLocation来取消。
Declared In
TencentLBSLocationManager.h
– cancelRequestLocation
取消单次定位
- (void)cancelRequestLocationDiscussion
取消单次定位
Declared In
TencentLBSLocationManager.h
– startUpdatingLocation
开始连续定位
- (void)startUpdatingLocationDiscussion
开始连续定位
Declared In
TencentLBSLocationManager.h
– stopUpdatingLocation
停止连续定位
- (void)stopUpdatingLocationDiscussion
停止连续定位
Declared In
TencentLBSLocationManager.h
– startUpdatingHeading
开启更新定位朝向
- (void)startUpdatingHeadingDiscussion
开启更新定位朝向
Declared In
TencentLBSLocationManager.h
– stopUpdatingHeading
结束更新定位朝向
- (void)stopUpdatingHeadingDiscussion
结束更新定位朝向
Declared In
TencentLBSLocationManager.h
– dismissHeadingCalibrationDisplay
停止展示定位朝向校准提示
- (void)dismissHeadingCalibrationDisplayDiscussion
停止展示定位朝向校准提示
Declared In
TencentLBSLocationManager.h
– isSupport
是否支持DR引擎 @return
- (BOOL)isSupportDiscussion
是否支持DR引擎 @return
Declared In
TencentLBSLocationManager.h
– startDrEngine:
启动DR引擎。引擎会自动获取传感器和GPS数据,并进行位置计算。 启动后DR引擎会主动开启CLLocationManager startUpdatingLocation。
- (TencentLBSDRStartCode)startDrEngine:(TencentLBSDRStartMotionType)typeParameters
type |
运动类型 目前支持,参考TencentLBSDRStartMotionType |
|---|
Return Value
返回码,参考TencentLBSDRStartCode
Discussion
启动DR引擎。引擎会自动获取传感器和GPS数据,并进行位置计算。 启动后DR引擎会主动开启CLLocationManager startUpdatingLocation。
注意:请确保调用之前已获取位置权限(使用期间或者始终允许)
Declared In
TencentLBSLocationManager.h
– terminateDrEngine
停止DR引擎。内部有极短时间延迟,若在此期间调用TencentLBSLocationManager startDrEngine:可能导致启动不成功。
- (void)terminateDrEngineDiscussion
停止DR引擎。内部有极短时间延迟,若在此期间调用TencentLBSLocationManager startDrEngine:可能导致启动不成功。
Declared In
TencentLBSLocationManager.h
– getPosition
主动获取DR实时融合位置,调用startDrEngine:成功后才可能有值,业务可根据自己的频率主动获取
- (TencentLBSLocation *)getPositionReturn Value
DR融合后的定位结果
Discussion
主动获取DR实时融合位置,调用startDrEngine:成功后才可能有值,业务可根据自己的频率主动获取
Declared In
TencentLBSLocationManager.h