Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
8094ab2f
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1595
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8094ab2f
编写于
10月 14, 2022
作者:
DCloud_iOS_XHY
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交 iOS 端 TencentLBS 示例
上级
84c71663
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
921 addition
and
1 deletion
+921
-1
pages/SDKIntegration/SDKIntegration.vue
pages/SDKIntegration/SDKIntegration.vue
+6
-0
uni_modules/uni-getbatteryinfo/utssdk/app-ios/index.uts
uni_modules/uni-getbatteryinfo/utssdk/app-ios/index.uts
+1
-1
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBS.h
...-ios/Frameworks/TencentLBS.framework/Headers/TencentLBS.h
+21
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocation.h
...meworks/TencentLBS.framework/Headers/TencentLBSLocation.h
+166
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocationManager.h
.../TencentLBS.framework/Headers/TencentLBSLocationManager.h
+374
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocationUtils.h
...ks/TencentLBS.framework/Headers/TencentLBSLocationUtils.h
+55
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Info.plist
...utssdk/app-ios/Frameworks/TencentLBS.framework/Info.plist
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Modules/module.modulemap
.../Frameworks/TencentLBS.framework/Modules/module.modulemap
+6
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/TencentLBS
...utssdk/app-ios/Frameworks/TencentLBS.framework/TencentLBS
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeDirectory
...meworks/TencentLBS.framework/_CodeSignature/CodeDirectory
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeRequirements
...orks/TencentLBS.framework/_CodeSignature/CodeRequirements
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeRequirements-1
...ks/TencentLBS.framework/_CodeSignature/CodeRequirements-1
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeResources
...meworks/TencentLBS.framework/_CodeSignature/CodeResources
+177
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeSignature
...meworks/TencentLBS.framework/_CodeSignature/CodeSignature
+0
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/index.uts
uni_modules/uts-tencentgeolocation/utssdk/app-ios/index.uts
+99
-0
uni_modules/uts-tencentgeolocation/utssdk/app-ios/info.plist
uni_modules/uts-tencentgeolocation/utssdk/app-ios/info.plist
+16
-0
未找到文件。
pages/SDKIntegration/SDKIntegration.vue
浏览文件 @
8094ab2f
...
...
@@ -49,6 +49,12 @@
title
:
'
执行结果:
'
+
addressDesc
,
icon
:
'
none
'
});
},
fail
:
function
(
msg
)
{
uni
.
showToast
({
title
:
msg
,
icon
:
"
none
"
})
}
})
...
...
uni_modules/uni-getbatteryinfo/utssdk/app-ios/index.uts
浏览文件 @
8094ab2f
...
...
@@ -12,7 +12,7 @@ export default function getBatteryInfo(options: GetBatteryInfoOptions) {
const res = {
errMsg: "getBatteryInfo:ok",
level:
UIDevice.current.batteryLevel * 100
,
level:
Number(UIDevice.current.batteryLevel * 100)
,
isCharging: UIDevice.current.batteryState == UIDevice.BatteryState.charging,
};
if (options.success != null) {
...
...
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBS.h
0 → 100644
浏览文件 @
8094ab2f
//
// TencentLBS.h
// TencentLBS
//
// Created by mirantslu on 16/4/19.
// Copyright © 2016年 Tencent. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for TencentLBS.
FOUNDATION_EXPORT
double
TencentLBSVersionNumber
;
//! Project version string for TencentLBS.
FOUNDATION_EXPORT
const
unsigned
char
TencentLBSVersionString
[];
// In this header, you should import all the public headers of your framework using statements like #import <TencentLBS/PublicHeader.h>
#import <TencentLBS/TencentLBSLocation.h>
#import <TencentLBS/TencentLBSLocationManager.h>
#import <TencentLBS/TencentLBSLocationUtils.h>
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocation.h
0 → 100644
浏览文件 @
8094ab2f
//
// TencentLBSLocation.h
// TencentLBS
//
// Created by mirantslu on 16/4/19.
// Copyright © 2016年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
NS_ASSUME_NONNULL_BEGIN
#define TENCENTLBS_DEBUG 0
typedef
NS_ENUM
(
NSInteger
,
TencentLBSDRProvider
)
{
TencentLBSDRProviderError
=
-
2
,
//!< 错误,可能未开启dr
TencentLBSDRProviderUnkown
=
-
1
,
//!< 定位结果来源未知
TencentLBSDRProviderFusion
=
0
,
//!< 定位结果来源融合的结果
TencentLBSDRProviderGPS
=
1
,
//!< 定位结果来源GPS
TencentLBSDRProviderNetWork
=
2
,
//!< 定位结果来源网络
};
@interface
TencentLBSPoi
:
NSObject
<
NSSecureCoding
,
NSCopying
>
@property
(
nonatomic
,
copy
)
NSString
*
uid
;
//!< 当前POI的uid
@property
(
nonatomic
,
copy
)
NSString
*
name
;
//!< 当前POI的名称
@property
(
nonatomic
,
copy
)
NSString
*
address
;
//!< 当前POI的地址
@property
(
nonatomic
,
copy
)
NSString
*
catalog
;
//!< 当前POI的类别
@property
(
nonatomic
,
assign
)
double
longitude
;
//!< 当前POI的经度
@property
(
nonatomic
,
assign
)
double
latitude
;
//!< 当前POI的纬度
@property
(
nonatomic
,
assign
)
double
distance
;
//!< 当前POI与当前位置的距离
@end
@interface
TencentLBSLocation
:
NSObject
<
NSSecureCoding
,
NSCopying
>
/**
* 返回当前位置的CLLocation信息
*/
@property
(
nonatomic
,
strong
)
CLLocation
*
location
;
/**
* 返回当前位置的行政区划, 0-表示中国大陆、港、澳, 1-表示其他
*/
@property
(
nonatomic
,
assign
)
NSInteger
areaStat
;
/**
* 返回室内定位楼宇Id
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
buildingId
;
/**
* 返回室内定位楼层
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
buildingFloor
;
/**
* 返回室内定位类型,0表示普通定位结果,1表示蓝牙室内定位结果
*/
@property
(
nonatomic
,
assign
)
NSInteger
indoorLocationType
;
/**
*
*/
@property
(
nonatomic
,
assign
)
TencentLBSDRProvider
drProvider
;
/**
* 返回当前位置的名称,
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelName或TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
name
;
/**
* 返回当前位置的地址
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelName或TencentLBSRequestLevelAdminName有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
address
;
/**
* 返回国家编码,例如中国为156
* <b>注意:该接口涉及到WebService API,请参考https://lbs.qq.com/service/webService/webServiceGuide/webServiceOverview中的配额限制说明,
* 并将申请的有效key通过TencentLBSLocationManager的- (void)setDataWithValue: forKey:方法设置,其中key为固定值@"ReGeoCodingnKey",例如[tencentLocationManager setDataWithValue:@"您申请的key(务必正确)" forKey:@"ReGeoCodingnKey"];,否则将返回默认值0</b>
*/
@property
(
nonatomic
,
assign
)
NSInteger
nationCode
;
/**
* 返回当前位置的城市编码
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
code
;
/**
* 返回当前位置的国家
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
nation
;
/**
* 返回当前位置的省份
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
province
;
/**
* 返回当前位置的城市固话编码.
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
cityPhoneCode
;
/**
* 返回当前位置的城市
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
city
;
/**
* 返回当前位置的区县
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
district
;
/**
* 返回当前位置的乡镇
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
town
;
/**
* 返回当前位置的村
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
village
;
/**
* 返回当前位置的街道
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
street
;
/**
* 返回当前位置的街道编码
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelAdminName或TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
street_no
;
/**
* 返回当前位置周围的POI
* 仅当TencentLBSRequestLevel为TencentLBSRequestLevelPoi有返回值,否则为空
*/
@property
(
nonatomic
,
strong
,
nullable
)
NSArray
<
TencentLBSPoi
*>
*
poiList
;
/**
* 返回两个位置之间的横向距离
* @param location
*/
-
(
double
)
distanceFromLocation
:(
const
TencentLBSLocation
*
)
location
;
// 测试使用
#if TENCENTLBS_DEBUG
@property
(
nonatomic
,
copy
,
nullable
)
NSString
*
halleyTime
;
#endif
@end
NS_ASSUME_NONNULL_END
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocationManager.h
0 → 100644
浏览文件 @
8094ab2f
//
// TencentLBSLocationManager.h
// TencentLBS
//
// Created by mirantslu on 16/4/19.
// Copyright © 2016年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "TencentLBSLocation.h"
NS_ASSUME_NONNULL_BEGIN
typedef
NS_ENUM
(
NSUInteger
,
TencentLBSRequestLevel
)
{
TencentLBSRequestLevelGeo
=
0
,
TencentLBSRequestLevelName
=
1
,
TencentLBSRequestLevelAdminName
=
3
,
TencentLBSRequestLevelPoi
=
4
,
};
typedef
NS_ENUM
(
NSUInteger
,
TencentLBSLocationCoordinateType
)
{
TencentLBSLocationCoordinateTypeGCJ02
=
0
,
//!< 火星坐标,即国测局坐标
TencentLBSLocationCoordinateTypeWGS84
=
1
,
//!< 地球坐标,注:如果是海外,无论设置的是火星坐标还是地球坐标,返回的都是地球坐标
};
typedef
NS_ENUM
(
NSUInteger
,
TencentLBSLocationError
)
{
TencentLBSLocationErrorUnknown
=
0
,
//!< 错误码,表示目前位置未知,但是会一直尝试获取
TencentLBSLocationErrorDenied
=
1
,
//!< 错误码,表示定位权限被禁止
TencentLBSLocationErrorNetwork
=
2
,
//!< 错误码,表示网络错误
TencentLBSLocationErrorHeadingFailure
=
3
,
//!< 错误码,表示朝向无法确认
TencentLBSLocationErrorOther
=
4
,
//!< 错误码,表示未知错误
};
typedef
NS_ENUM
(
NSInteger
,
TencentLBSDRStartCode
)
{
TencentLBSDRStartCodeSuccess
=
0
,
//!< 启动成功
TencentLBSDRStartCodeNotSupport
=
-
1
,
//!< 传感器有缺失或没有GPS芯片
TencentLBSDRStartCodeHasStarted
=
-
2
,
//!< 已经启动
TencentLBSDRStartCodeSensorFailed
=
-
3
,
//!< 传感器启动失败
TencentLBSDRStartCodeGpsFailed
=
-
4
,
//!< GPS启动失败
TencentLBSDRStartCodePermissionFailed
=
-
5
,
//!< 没有位置权限
TencentLBSDRStartCodeUnkown
=
-
6
,
//!< 未知
};
typedef
NS_ENUM
(
NSInteger
,
TencentLBSDRStartMotionType
)
{
TencentLBSDRStartMotionTypeWalk
=
2
,
//!< 步行
TencentLBSDRStartMotionTypeBike
=
3
,
//!< 骑行
};
typedef
NS_ENUM
(
NSInteger
,
TencentLBSAccuracyAuthorization
)
{
// This application has the user's permission to receive accurate location information.
TencentLBSAccuracyAuthorizationFullAccuracy
,
// The user has chosen to grant this application access to location information with reduced accuracy.
// Region monitoring and beacon ranging are not available to the application. Other CoreLocation APIs
// are available with reduced accuracy.
// Location estimates will have a horizontalAccuracy on the order of about 5km. To achieve the
// reduction in accuracy, CoreLocation will snap location estimates to a nearby point which represents
// the region the device is in. Furthermore, CoreLocation will reduce the rate at which location
// estimates are produced. Applications should be prepared to receive locations that are up to 20
// minutes old.
TencentLBSAccuracyAuthorizationReducedAccuracy
,
};
/**
* TencentLBSLocatingCompletionBlock 单次定位返回Block
*
* @param location 位置信息
* @param error 错误信息 参考 TencentLBSLocationError
*/
typedef
void
(
^
TencentLBSLocatingCompletionBlock
)(
TencentLBSLocation
*
_Nullable
location
,
NSError
*
_Nullable
error
);
@protocol
TencentLBSLocationManagerDelegate
;
@interface
TencentLBSLocationManager
:
NSObject
/**
* 当前位置管理器定位精度的授权状态
*/
@property
(
nonatomic
,
readonly
)
TencentLBSAccuracyAuthorization
accuracyAuthorization
;
/**
* 当前位置管理器定位权限的授权状态
*/
@property
(
nonatomic
,
readonly
)
CLAuthorizationStatus
authorizationStatus
;
/**
* API Key, 在使用定位SDK服务之前需要先绑定key。
*/
@property
(
nonatomic
,
copy
)
NSString
*
apiKey
;
/**
* 实现了 TencentLBSLocationManagerDelegate 协议的类指针。
*/
@property
(
nonatomic
,
weak
)
id
<
TencentLBSLocationManagerDelegate
>
delegate
;
/**
* 设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
*/
@property
(
nonatomic
,
assign
)
CLLocationDistance
distanceFilter
;
/**
* 设定定位精度。默认为 kCLLocationAccuracyBest 。
*/
@property
(
nonatomic
,
assign
)
CLLocationAccuracy
desiredAccuracy
;
/**
* 指定定位是否会被系统自动暂停。默认为 YES 。
*/
@property
(
nonatomic
,
assign
)
BOOL
pausesLocationUpdatesAutomatically
;
/**
* 是否允许后台定位。默认为 NO。
* iOS 9.0 以上用户需要设置该选项并且在info.list里面Background Modes 中的 Location updates 处于选中状态才可以使用后台定位权限。iOS 9.0之前可以直接申请总是使用的权限来获得后台定位。
*
* 设置为 YES 的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
*/
@property
(
nonatomic
,
assign
)
BOOL
allowsBackgroundLocationUpdates
;
/**
* 用户的活动类型
*
* 设置用户的活动类型。默认值为 CLActivityTypeOther
*/
@property
(
nonatomic
,
assign
)
CLActivityType
activityType
;
/**
* 设置当朝向改变时,每隔多少度调用一次
* 只有当设备方向的改变值超过该属性值时才激发delegate的方法。
*/
@property
(
nonatomic
,
assign
)
CLLocationDegrees
headingFilter
;
/**
* 设置设备当前的朝向
*/
@property
(
nonatomic
,
assign
)
CLDeviceOrientation
headingOrientation
;
/**
* 连续定位的逆地理信息请求的Level。默认为TencentLBSRequestLevelGeo
*/
@property
(
nonatomic
,
assign
)
TencentLBSRequestLevel
requestLevel
;
/**
* 返回的TencentLBSLocation的location字段的坐标类型。默认为TencentLBSLocationCoordinateTypeGCJ02。
*
* 在一次定位过程中,只允许设置一次,不允许重复设置
*/
@property
(
nonatomic
,
assign
)
TencentLBSLocationCoordinateType
coordinateType
;
/**
* 指定POI的更新间隔。 默认是10s
*/
@property
(
nonatomic
,
assign
)
NSInteger
poiUpdateInterval
;
#pragma mark -
/**
* accuracyAuthorization
*
* Discussion:
* Return the current TencentLBSAccuracyAuthorization of the calling application.
*/
+
(
TencentLBSAccuracyAuthorization
)
accuracyAuthorization
;
/**
* 设置用户是否同意隐私协议政策
* <p>调用其他接口前必须首先调用此接口进行用户是否同意隐私政策的设置,传入YES后才能正常使用定位功能,否则TencentLBSLocationManager初始化不成功,返回nil,定位功能均无法使用</p>
* @param isAgree 是否同意隐私政策
*/
+
(
void
)
setUserAgreePrivacy
:(
BOOL
)
isAgree
;
/**
* 获取用户是否同意隐私政策协议
* <p>设置用户隐私后,可通过该接口判断用户隐私状态</p>
* @return isAgreePrivacy 是否同意隐私政策
*/
+
(
BOOL
)
getUserAgreePrivacy
;
#pragma mark -
-
(
void
)
requestWhenInUseAuthorization
;
-
(
void
)
requestAlwaysAuthorization
;
/**
* 当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
* @param purposeKey 需要在info.plist中配置NSLocationTemporaryUsageDescriptionDictionary key值和对应的申请该权限的描述理由
* @param completion 在弹框让用户选择后的用户的反馈,如果用户授予该权限,block中的参数为nil,如果未授予,block中的参数将为PurposeKey对于的key的描述(如PurposeKey=TemporaryPurposKey_1)
*/
-
(
void
)
requestTemporaryFullAccuracyAuthorizationWithPurposeKey
:(
NSString
*
)
purposeKey
completion
:(
void
(
^
)(
NSError
*
))
completion
;
/**
* 当前属于模糊定位状态时,通过该接口请求暂时的完全定位精度的权限
* @param purposeKey 需要在info.plist中配置NSLocationTemporaryUsageDescriptionDictionary key值和对应的申请该权限的描述理由
*/
-
(
void
)
requestTemporaryFullAccuracyAuthorizationWithPurposeKey
:(
NSString
*
)
purposeKey
;
#pragma mark -
/**
* 获取定位SDK的版本
*/
+
(
NSString
*
)
getLBSSDKVersion
;
/**
* 获取定位SDK的构建日期
*/
+
(
NSString
*
)
getLBSSDKbuild
;
#pragma mark -
/**
* 向SDK内部设置数据,以满足定制的需求
* @param value
* @param key
*/
-
(
void
)
setDataWithValue
:(
NSString
*
)
value
forKey
:(
NSString
*
)
key
;
/**
* 单次定位
*
* 该方法为下面方法的一层封装。
* level默认是TencentLBSRequestLevelPoi
* timeout默认是10s
*/
-
(
BOOL
)
requestLocationWithCompletionBlock
:(
TencentLBSLocatingCompletionBlock
)
completionBlock
;
/**
* 单次定位
*
* 注意:不能连续调用该接口,需在上一次返回之后才能再次发起调用。该接口兼容iOS 7.0及以上,因iOS 9.0系统提供单次定位能力,故在9.0以上会调用系统单次定位接口,9.0之前SDK完成封装。可以通过调用cancelRequestLocation来取消。
*
* @param level 可以根据此参数来对应的获取POI信息
* @param timeout 表示获取POI的超时时间。
* @param completionBlock 单次定位完成后的Block
*/
-
(
BOOL
)
requestLocationWithRequestLevel
:(
TencentLBSRequestLevel
)
level
locationTimeout
:(
NSTimeInterval
)
timeout
completionBlock
:(
TencentLBSLocatingCompletionBlock
)
completionBlock
;
/**
* 取消单次定位
**/
-
(
void
)
cancelRequestLocation
;
/**
* 开始连续定位
*/
-
(
void
)
startUpdatingLocation
;
/**
* 停止连续定位
*/
-
(
void
)
stopUpdatingLocation
;
/**
* 开启更新定位朝向
*/
-
(
void
)
startUpdatingHeading
;
/**
* 结束更新定位朝向
*/
-
(
void
)
stopUpdatingHeading
;
/**
* 停止展示定位朝向校准提示
*/
-
(
void
)
dismissHeadingCalibrationDisplay
;
#pragma mark - PDR 对外接口
/**
* 主动获取DR实时融合位置,调用startDrEngine:成功后才可能有值,业务可根据自己的频率主动获取
* @return DR融合后的定位结果
*/
-
(
TencentLBSLocation
*
)
getPosition
;
/**
* 启动DR引擎。引擎会自动获取传感器和GPS数据,并进行位置计算。
* 启动后DR引擎会主动开启CLLocationManager startUpdatingLocation。
*
* 注意:请确保调用之前已获取位置权限(使用期间或者始终允许)
*
* @param type 运动类型 目前支持,参考TencentLBSDRStartMotionType
* @return 返回码,参考TencentLBSDRStartCode
*/
-
(
TencentLBSDRStartCode
)
startDrEngine
:(
TencentLBSDRStartMotionType
)
type
;
/**
* 停止DR引擎。内部有极短时间延迟,若在此期间调用TencentLBSLocationManager startDrEngine:可能导致启动不成功。
*/
-
(
void
)
terminateDrEngine
;
/**
* 是否支持DR引擎
* @return
*/
-
(
BOOL
)
isSupport
;
#pragma mark - test used
// 测试使用
#if TENCENTLBS_DEBUG
+
(
void
)
upLoadData
;
+
(
NSData
*
)
getLocationLog
;
+
(
void
)
newLocationLog
;
#endif
@end
#pragma mark - TencentLBSLocationManagerDelegate
/**
* TencentLBSLocationManagerDelegate
* 定义了发生错误时的错误回调方法,连续定位的回调方法等。
*/
@protocol
TencentLBSLocationManagerDelegate
<
NSObject
>
@optional
/**
* 当定位发生错误时,会调用代理的此方法
*
* @param manager 定位 TencentLBSLocationManager 类
* @param error 返回的错误,参考 TencentLBSLocationError
*/
-
(
void
)
tencentLBSLocationManager
:(
TencentLBSLocationManager
*
)
manager
didFailWithError
:(
NSError
*
)
error
;
/**
* 连续定位回调函数
*
* @param manager 定位 TencentLBSLocationManager 类
* @param location 定位结果
*/
-
(
void
)
tencentLBSLocationManager
:(
TencentLBSLocationManager
*
)
manager
didUpdateLocation
:(
TencentLBSLocation
*
)
location
;
/**
* 定位权限状态改变时回调函数
* @deprecated 在iOS 14及以上废弃,由tencentLBSDidChangeAuthorization:代替
* @param manager 定位 TencentLBSLocationManager 类
* @param status 定位权限状态
*/
-
(
void
)
tencentLBSLocationManager
:(
TencentLBSLocationManager
*
)
manager
didChangeAuthorizationStatus
:(
CLAuthorizationStatus
)
status
;
/**
* 定位权限状态改变时回调函数
* @param manager 定位 TencentLBSLocationManager 类,由此访问authorizationStatus,accuracyAuthorization
*/
-
(
void
)
tencentLBSDidChangeAuthorization
:(
TencentLBSLocationManager
*
)
manager
;
/**
* 定位朝向改变时回调函数
*
* @param manager 定位 TencentLBSLocationManager 类
* @param newHeading 新的定位朝向
*/
-
(
void
)
tencentLBSLocationManager
:(
TencentLBSLocationManager
*
)
manager
didUpdateHeading
:(
CLHeading
*
)
newHeading
;
/**
* 是否展示定位朝向校准提示的回调函数
*
* @param manager 定位 TencentLBSLocationManager 类
*/
-
(
BOOL
)
tencentLBSLocationManagerShouldDisplayHeadingCalibration
:(
TencentLBSLocationManager
*
)
manager
;
/**
* 只是内部调试使用,外部不应实现该接口
*/
-
(
void
)
tencentLBSLocationManager
:(
TencentLBSLocationManager
*
)
manager
didThrowLocation
:(
TencentLBSLocation
*
)
location
;
@end
NS_ASSUME_NONNULL_END
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Headers/TencentLBSLocationUtils.h
0 → 100644
浏览文件 @
8094ab2f
//
// TencentLBSLocationUtils.h
// TencentLBS
//
// Created by mirantslu on 16/8/11.
// Copyright © 2016年 Tencent. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@class
TencentLBSLocation
;
NS_ASSUME_NONNULL_BEGIN
@interface
TencentLBSLocationUtils
:
NSObject
/**
* 计算两个坐标点的距离
*/
+
(
double
)
distanceBetweenTwoCoordinate2D
:(
const
CLLocationCoordinate2D
*
)
coordinate
coordinateTwo
:(
const
CLLocationCoordinate2D
*
)
coordinate2
;
/**
* 计算两个location的距离
*/
+
(
double
)
distanceBetweenTwoCLLocations
:(
const
CLLocation
*
)
location
locationTwo
:(
const
CLLocation
*
)
location2
;
/**
* 计算两个TencentLBSLocation的距离
*/
+
(
double
)
distanceBetweenTwoTencentLBSLocations
:(
const
TencentLBSLocation
*
)
location
locationTwo
:(
const
TencentLBSLocation
*
)
location2
;
/**
* 判断经纬度是否在国内
*
*/
+
(
BOOL
)
isInRegionWithLatitude
:(
double
)
latitude
longitude
:(
double
)
longitude
;
/**
* wgs84坐标转成gcj02坐标
*/
+
(
CLLocationCoordinate2D
)
WGS84TOGCJ02
:(
CLLocationCoordinate2D
)
coordinate
;
@end
@interface
TencentLBSServiceManager
:
NSObject
/**
* 设置ID,如QQ号,微信号或是其他的登录账号,可用在发布前联调使用
*/
@property
(
atomic
,
copy
)
NSString
*
deviceID
;
+
(
instancetype
)
sharedInsance
;
@end
NS_ASSUME_NONNULL_END
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Info.plist
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/Modules/module.modulemap
0 → 100644
浏览文件 @
8094ab2f
framework module TencentLBS {
umbrella header "TencentLBS.h"
export *
module * { export * }
}
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/TencentLBS
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeDirectory
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeRequirements
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeRequirements-1
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeResources
0 → 100644
浏览文件 @
8094ab2f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
files
</key>
<dict>
<key>
Headers/TencentLBS.h
</key>
<data>
hPC0/pGd4xrqNOXCT59Bc4EZx1o=
</data>
<key>
Headers/TencentLBSLocation.h
</key>
<data>
NTNAtRb6zd+vtrq8nFcrm/TvTno=
</data>
<key>
Headers/TencentLBSLocationManager.h
</key>
<data>
CqufUOM9qpXc8PkBQcTH7nFlxHU=
</data>
<key>
Headers/TencentLBSLocationUtils.h
</key>
<data>
ctiCEOKB25KPpldhCiCitDpWjsc=
</data>
<key>
Info.plist
</key>
<data>
dF6t7k2l2ACuPcw4w8e+8pX3Ds8=
</data>
<key>
Modules/module.modulemap
</key>
<data>
jS4bVEIZ8y6+mkDDypFhD0RkQVg=
</data>
</dict>
<key>
files2
</key>
<dict>
<key>
Headers/TencentLBS.h
</key>
<dict>
<key>
hash
</key>
<data>
hPC0/pGd4xrqNOXCT59Bc4EZx1o=
</data>
<key>
hash2
</key>
<data>
rXSLg9Gmqf/qi8hc0spd2V99ElDyGiIgDgvN30bahIQ=
</data>
</dict>
<key>
Headers/TencentLBSLocation.h
</key>
<dict>
<key>
hash
</key>
<data>
NTNAtRb6zd+vtrq8nFcrm/TvTno=
</data>
<key>
hash2
</key>
<data>
LmWBqRV/iCuLqRmuUPDGqTOz3n2XBrAIRkPpulu9Dms=
</data>
</dict>
<key>
Headers/TencentLBSLocationManager.h
</key>
<dict>
<key>
hash
</key>
<data>
CqufUOM9qpXc8PkBQcTH7nFlxHU=
</data>
<key>
hash2
</key>
<data>
ozYu6o4odbCMlj5n6GijSLmHlND06j8bgS/wHNmwwkI=
</data>
</dict>
<key>
Headers/TencentLBSLocationUtils.h
</key>
<dict>
<key>
hash
</key>
<data>
ctiCEOKB25KPpldhCiCitDpWjsc=
</data>
<key>
hash2
</key>
<data>
clmnufMVF2VLg4uOOY70pixlfbrZK20rr/iOxOF4+E4=
</data>
</dict>
<key>
Modules/module.modulemap
</key>
<dict>
<key>
hash
</key>
<data>
jS4bVEIZ8y6+mkDDypFhD0RkQVg=
</data>
<key>
hash2
</key>
<data>
j/3Yn2sASML4eiVUc877N1Qdw84cRUiapBx3Gc88OUI=
</data>
</dict>
</dict>
<key>
rules
</key>
<dict>
<key>
^.*
</key>
<true/>
<key>
^.*\.lproj/
</key>
<dict>
<key>
optional
</key>
<true/>
<key>
weight
</key>
<real>
1000
</real>
</dict>
<key>
^.*\.lproj/locversion.plist$
</key>
<dict>
<key>
omit
</key>
<true/>
<key>
weight
</key>
<real>
1100
</real>
</dict>
<key>
^Base\.lproj/
</key>
<dict>
<key>
weight
</key>
<real>
1010
</real>
</dict>
<key>
^version.plist$
</key>
<true/>
</dict>
<key>
rules2
</key>
<dict>
<key>
.*\.dSYM($|/)
</key>
<dict>
<key>
weight
</key>
<real>
11
</real>
</dict>
<key>
^(.*/)?\.DS_Store$
</key>
<dict>
<key>
omit
</key>
<true/>
<key>
weight
</key>
<real>
2000
</real>
</dict>
<key>
^.*
</key>
<true/>
<key>
^.*\.lproj/
</key>
<dict>
<key>
optional
</key>
<true/>
<key>
weight
</key>
<real>
1000
</real>
</dict>
<key>
^.*\.lproj/locversion.plist$
</key>
<dict>
<key>
omit
</key>
<true/>
<key>
weight
</key>
<real>
1100
</real>
</dict>
<key>
^Base\.lproj/
</key>
<dict>
<key>
weight
</key>
<real>
1010
</real>
</dict>
<key>
^Info\.plist$
</key>
<dict>
<key>
omit
</key>
<true/>
<key>
weight
</key>
<real>
20
</real>
</dict>
<key>
^PkgInfo$
</key>
<dict>
<key>
omit
</key>
<true/>
<key>
weight
</key>
<real>
20
</real>
</dict>
<key>
^embedded\.provisionprofile$
</key>
<dict>
<key>
weight
</key>
<real>
20
</real>
</dict>
<key>
^version\.plist$
</key>
<dict>
<key>
weight
</key>
<real>
20
</real>
</dict>
</dict>
</dict>
</plist>
uni_modules/uts-tencentgeolocation/utssdk/app-ios/Frameworks/TencentLBS.framework/_CodeSignature/CodeSignature
0 → 100644
浏览文件 @
8094ab2f
文件已添加
uni_modules/uts-tencentgeolocation/utssdk/app-ios/index.uts
0 → 100644
浏览文件 @
8094ab2f
import { CLLocationManager, CLAuthorizationStatus } from "CoreLocation"
import { TencentLBSLocationManager, TencentLBSLocation, Error, TencentLBSRequestLevel} from "TencentLBS"
import Bundle from "Foundation"
/**
* 定位请求参数封装
*/
type LocationOptions = {
geocode: boolean,
success: (response: LocationResponse) => void,
fail: (msg: string) => void
};
/**
* 定位返回结果封装
*/
type LocationResponse = {
name: string,
address: string,
latitude: number,
longitude: number
}
class LBSLocation {
// 定义 locationManager 属性,类型为 TencentLBSLocationManager
static locationManager: TencentLBSLocationManager
// 初始化 locationManager 方法
static configLocationManager(): boolean {
if (this.locationManager == null) {
// 从 info.plist 中读取 apiKey
const apiKey = Bundle.main.infoDictionary?.["TencentLBSAPIKey"]
// infoDictionary 获取的值类型为 any?
if (apiKey == null) {
// 如果 apiKey 为 null 返回 false
return false
}
// 调用API前需要设置同意用户隐私协议
TencentLBSLocationManager.setUserAgreePrivacy(true)
// 初始化 locationManager 实例对象
this.locationManager = new TencentLBSLocationManager()
// 设置 apiKey (因为 apiKey 是 any?类型,需要转成 string 类型赋值)
this.locationManager.apiKey = apiKey! as string;
// this.locationManager.apiKey = "LZTBZ-77PCJ-HJAFN-KWXJ2-H357V-DJBK4"
this.locationManager.allowsBackgroundLocationUpdates = true
}
return true
}
static requestPremission() {
this.configLocationManager()
const status = CLLocationManager.authorizationStatus()
if (status == CLAuthorizationStatus.notDetermined) {
this.locationManager.requestWhenInUseAuthorization()
}
}
static getLocation(locationOptions: LocationOptions): boolean {
// 初始化 locationManager
if (!this.configLocationManager()) {
// 初始化失败返回 false
return false
}
let requestLevel = TencentLBSRequestLevel.geo
if (locationOptions.geocode) {
requestLevel = TencentLBSRequestLevel.name
}
this.locationManager.requestLocation(with = requestLevel, locationTimeout = 10, completionBlock = (location?: TencentLBSLocation, err?: Error): void => {
if (location != null) {
let response = new LocationResponse();
response.name = location!.name;
response.address = location!.address;
response.latitude = Number(location!.location.coordinate.latitude);
response.longitude = Number(location!.location.coordinate.longitude);
locationOptions.success(response);
} else {
locationOptions.fail(err!.localizedDescription)
}
})
return true
}
}
export function requestPremission() {
LBSLocation.requestPremission()
}
export function getLocation(locationOptions: LocationOptions): boolean {
return LBSLocation.getLocation(locationOptions)
}
\ No newline at end of file
uni_modules/uts-tencentgeolocation/utssdk/app-ios/info.plist
0 → 100644
浏览文件 @
8094ab2f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
NSLocationAlwaysUsageDescription
</key>
<string>
访问位置权限
</string>
<key>
NSLocationWhenInUseUsageDescription
</key>
<string>
使用期间获取位置权限
</string>
<key>
TencentLBSAPIKey
</key>
<string>
LZTBZ-77PCJ-HJAFN-KWXJ2-H357V-DJBK4
</string>
<key>
UIBackgroundModes
</key>
<array>
<string>
location
</string>
</array>
</dict>
</plist>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录