capacitor-baidu-location 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/Info.plist +43 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/BMKLocationKit +0 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/BMKLocationKit.xcprivacy +64 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKGeoFenceManager.h +168 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKGeoFenceRegion.h +114 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocation.h +112 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationAuth.h +71 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationComponent.h +16 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationKitVersion.h +30 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationManager.h +303 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationPoi.h +42 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationPoiRegion.h +35 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Headers/BMKLocationReGeocode.h +69 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Info.plist +36 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/Modules/module.modulemap +6 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/BMKLocationKit +0 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKGeoFenceManager.h +168 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKGeoFenceRegion.h +114 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocation.h +112 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationAuth.h +71 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationComponent.h +16 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationKitVersion.h +30 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationManager.h +303 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationPoi.h +42 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationPoiRegion.h +35 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Headers/BMKLocationReGeocode.h +69 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Info.plist +36 -0
- package/ios/Frameworks/BMKLocationKit.xcframework/ios-x86_64-simulator/BMKLocationKit.framework/Modules/module.modulemap +6 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -352,6 +352,13 @@ const getCurrentCoordinateType = async () => {
|
|
|
352
352
|
|
|
353
353
|
[iOS 错误码](https://lbs.baidu.com/faq/api?title=ios-locsdk/guide/addition-func/error-code)
|
|
354
354
|
|
|
355
|
+
## 版本更新
|
|
356
|
+
|
|
357
|
+
- **0.0.3**:
|
|
358
|
+
- 补充 ios 平台缺少的百度定位框架
|
|
359
|
+
|
|
360
|
+
更多详情请参考 [CHANGELOG.md](CHANGELOG.md)
|
|
361
|
+
|
|
355
362
|
## 故障排除
|
|
356
363
|
|
|
357
364
|
### API Key 设置失败
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>BMKLocationKit.framework/BMKLocationKit</string>
|
|
10
|
+
<key>LibraryIdentifier</key>
|
|
11
|
+
<string>ios-x86_64-simulator</string>
|
|
12
|
+
<key>LibraryPath</key>
|
|
13
|
+
<string>BMKLocationKit.framework</string>
|
|
14
|
+
<key>SupportedArchitectures</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>x86_64</string>
|
|
17
|
+
</array>
|
|
18
|
+
<key>SupportedPlatform</key>
|
|
19
|
+
<string>ios</string>
|
|
20
|
+
<key>SupportedPlatformVariant</key>
|
|
21
|
+
<string>simulator</string>
|
|
22
|
+
</dict>
|
|
23
|
+
<dict>
|
|
24
|
+
<key>BinaryPath</key>
|
|
25
|
+
<string>BMKLocationKit.framework/BMKLocationKit</string>
|
|
26
|
+
<key>LibraryIdentifier</key>
|
|
27
|
+
<string>ios-arm64</string>
|
|
28
|
+
<key>LibraryPath</key>
|
|
29
|
+
<string>BMKLocationKit.framework</string>
|
|
30
|
+
<key>SupportedArchitectures</key>
|
|
31
|
+
<array>
|
|
32
|
+
<string>arm64</string>
|
|
33
|
+
</array>
|
|
34
|
+
<key>SupportedPlatform</key>
|
|
35
|
+
<string>ios</string>
|
|
36
|
+
</dict>
|
|
37
|
+
</array>
|
|
38
|
+
<key>CFBundlePackageType</key>
|
|
39
|
+
<string>XFWK</string>
|
|
40
|
+
<key>XCFrameworkFormatVersion</key>
|
|
41
|
+
<string>1.0</string>
|
|
42
|
+
</dict>
|
|
43
|
+
</plist>
|
package/ios/Frameworks/BMKLocationKit.xcframework/ios-arm64/BMKLocationKit.framework/BMKLocationKit
ADDED
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>NSPrivacyTracking</key>
|
|
6
|
+
<false/>
|
|
7
|
+
<key>NSPrivacyTrackingDomains</key>
|
|
8
|
+
<array/>
|
|
9
|
+
<key>NSPrivacyAccessedAPITypes</key>
|
|
10
|
+
<array>
|
|
11
|
+
<dict>
|
|
12
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
13
|
+
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
14
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>CA92.1</string>
|
|
17
|
+
</array>
|
|
18
|
+
</dict>
|
|
19
|
+
<dict>
|
|
20
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
21
|
+
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
|
22
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
23
|
+
<array>
|
|
24
|
+
<string>E174.1</string>
|
|
25
|
+
</array>
|
|
26
|
+
</dict>
|
|
27
|
+
<dict>
|
|
28
|
+
<key>NSPrivacyAccessedAPIType</key>
|
|
29
|
+
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
30
|
+
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
31
|
+
<array>
|
|
32
|
+
<string>C617.1</string>
|
|
33
|
+
</array>
|
|
34
|
+
</dict>
|
|
35
|
+
</array>
|
|
36
|
+
<key>NSPrivacyCollectedDataTypes</key>
|
|
37
|
+
<array>
|
|
38
|
+
<dict>
|
|
39
|
+
<key>NSPrivacyCollectedDataType</key>
|
|
40
|
+
<string>NSPrivacyCollectedDataTypeUserID</string>
|
|
41
|
+
<key>NSPrivacyCollectedDataTypeLinked</key>
|
|
42
|
+
<false/>
|
|
43
|
+
<key>NSPrivacyCollectedDataTypeTracking</key>
|
|
44
|
+
<false/>
|
|
45
|
+
<key>NSPrivacyCollectedDataTypePurposes</key>
|
|
46
|
+
<array>
|
|
47
|
+
<string>NSPrivacyCollectedDataTypePurposeAnalytics</string>
|
|
48
|
+
</array>
|
|
49
|
+
</dict>
|
|
50
|
+
<dict>
|
|
51
|
+
<key>NSPrivacyCollectedDataType</key>
|
|
52
|
+
<string>Precise location</string>
|
|
53
|
+
<key>NSPrivacyCollectedDataTypeLinked</key>
|
|
54
|
+
<false/>
|
|
55
|
+
<key>NSPrivacyCollectedDataTypeTracking</key>
|
|
56
|
+
<false/>
|
|
57
|
+
<key>NSPrivacyCollectedDataTypePurposes</key>
|
|
58
|
+
<array>
|
|
59
|
+
<string>App functionality</string>
|
|
60
|
+
</array>
|
|
61
|
+
</dict>
|
|
62
|
+
</array>
|
|
63
|
+
</dict>
|
|
64
|
+
</plist>
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKGeoFenceManager.h
|
|
3
|
+
// BMKLocationKit
|
|
4
|
+
//
|
|
5
|
+
// Created by baidu on 2017/3/2.
|
|
6
|
+
// Copyright © 2017年 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "BMKGeoFenceRegion.h"
|
|
10
|
+
#import "BMKLocation.h"
|
|
11
|
+
|
|
12
|
+
@protocol BMKGeoFenceManagerDelegate;
|
|
13
|
+
|
|
14
|
+
///地理围栏监听状态类型
|
|
15
|
+
typedef NS_OPTIONS(NSUInteger, BMKGeoFenceActiveAction)
|
|
16
|
+
{
|
|
17
|
+
BMKGeoFenceActiveActionNone = 0, ///< 不进行监听
|
|
18
|
+
BMKGeoFenceActiveActionInside = 1 << 0, ///< 在范围内
|
|
19
|
+
BMKGeoFenceActiveActionOutside = 1 << 1, ///< 在范围外
|
|
20
|
+
BMKGeoFenceActiveActionStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
///BMKGeoFence errorDomain
|
|
24
|
+
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKGeoFenceErrorDomain;
|
|
25
|
+
|
|
26
|
+
///地理围栏错误码
|
|
27
|
+
typedef NS_ENUM(NSInteger, BMKGeoFenceErrorCode) {
|
|
28
|
+
BMKGeoFenceErrorUnknown = 1, ///< 未知错误
|
|
29
|
+
BMKGeoFenceErrorInvalidParameter = 2, ///< 参数错误
|
|
30
|
+
BMKGeoFenceErrorFailureConnection = 3, ///< 网络连接异常
|
|
31
|
+
BMKGeoFenceErrorFailureAuth = 4, ///< 鉴权失败
|
|
32
|
+
BMKGeoFenceErrorNoValidFence = 5, ///< 无可用围栏
|
|
33
|
+
BMKGeoFenceErroFailureLocating = 6, ///< 定位错误
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
///地理围栏管理类
|
|
38
|
+
@interface BMKGeoFenceManager : NSObject
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
///实现了 BMKGeoFenceManagerDelegate 协议的类指针。
|
|
42
|
+
@property (nonatomic, weak, nullable) id<BMKGeoFenceManagerDelegate> delegate;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
///需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。
|
|
46
|
+
@property (nonatomic, assign) BMKGeoFenceActiveAction activeAction;
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
///设定定位的最小更新距离。默认为 kCLDistanceFilterNone。
|
|
50
|
+
@property(nonatomic, assign) CLLocationDistance distanceFilter;
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
///设定定位精度。默认为 kCLLocationAccuracyBest。
|
|
54
|
+
@property(nonatomic, assign) CLLocationAccuracy desiredAccuracy;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
///设定定位类型。默认为 CLActivityTypeAutomotiveNavigation。
|
|
58
|
+
@property(nonatomic, assign) CLActivityType activityType;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
///指定定位是否会被系统自动暂停。默认为NO。
|
|
62
|
+
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
|
|
66
|
+
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @brief 添加一个圆形围栏
|
|
71
|
+
* @param center 围栏的中心点经纬度坐标
|
|
72
|
+
* @param radius 围栏的半径,单位:米,要求大于0
|
|
73
|
+
* @param type 围栏的坐标系类型
|
|
74
|
+
* @param customID 用户自定义ID,可选,SDK原值返回
|
|
75
|
+
*/
|
|
76
|
+
- (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @brief 根据经纬度坐标数据添加一个闭合的多边形围栏,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
|
|
81
|
+
* @param coordinates 经纬度坐标点数据,coordinates对应的内存会拷贝,调用者负责该内存的释放
|
|
82
|
+
* @param count 经纬度坐标点的个数,不可小于3个
|
|
83
|
+
* @param type 围栏的坐标系类型
|
|
84
|
+
* @param customID 用户自定义ID,可选,SDK原值返回
|
|
85
|
+
*/
|
|
86
|
+
- (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coordinates count:(NSInteger)count coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @brief 根据customID获得指定的围栏,如果customID传nil,则返回全部围栏
|
|
91
|
+
* @param customID 用户执行添加围栏函数时传入的customID
|
|
92
|
+
* @return 获得的围栏构成的数组,如果没有结果,返回nil
|
|
93
|
+
*/
|
|
94
|
+
- (NSArray * _Nullable)geoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @brief 移除指定围栏
|
|
99
|
+
* @param region 要停止监控的围栏
|
|
100
|
+
*/
|
|
101
|
+
- (void)removeTheGeoFenceRegion:(BMKGeoFenceRegion * _Nonnull)region;
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @brief 移除指定customID的围栏
|
|
106
|
+
* @param customID 用户执行添加围栏函数时传入的customID
|
|
107
|
+
*/
|
|
108
|
+
- (void)removeGeoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @brief 移除所有围栏
|
|
113
|
+
*/
|
|
114
|
+
- (void)removeAllGeoFenceRegions;
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@end
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
///地理围栏代理协议,该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
|
|
122
|
+
@protocol BMKGeoFenceManagerDelegate <NSObject>
|
|
123
|
+
|
|
124
|
+
@optional
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @brief 为了适配app store关于新的后台定位的审核机制(app store要求如果开发者只配置了使用期间定位,则代码中不能出现申请后台定位的逻辑),当开发者在plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时,需要在该delegate中调用后台定位api:[locationManager requestAlwaysAuthorization]。开发者如果只配置了NSLocationWhenInUseUsageDescription,且只有使用期间的定位需求,则无需在delegate中实现逻辑。
|
|
128
|
+
* @param manager 定位 BMKGeoFenceManager 类。
|
|
129
|
+
* @param locationManager 系统 CLLocationManager 类 。
|
|
130
|
+
* @since 1.7.0
|
|
131
|
+
*/
|
|
132
|
+
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @brief 添加地理围栏完成后的回调,成功与失败都会调用
|
|
136
|
+
* @param manager 地理围栏管理类
|
|
137
|
+
* @param regions 成功添加的一个或多个地理围栏构成的数组
|
|
138
|
+
* @param customID 用户执行添加围栏函数时传入的customID
|
|
139
|
+
* @param error 添加失败的错误信息
|
|
140
|
+
*/
|
|
141
|
+
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didAddRegionForMonitoringFinished:(NSArray <BMKGeoFenceRegion *> * _Nullable)regions customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @brief 地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用
|
|
146
|
+
* @param manager 地理围栏管理类
|
|
147
|
+
* @param region 状态改变的地理围栏
|
|
148
|
+
* @param customID 用户执行添加围栏函数时传入的customID
|
|
149
|
+
* @param error 错误信息,如定位相关的错误
|
|
150
|
+
*/
|
|
151
|
+
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didGeoFencesStatusChangedForRegion:(BMKGeoFenceRegion * _Nullable)region customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @brief 地理围栏内部的连续定位回调,如需停止定位请移除所有地理围栏
|
|
155
|
+
* @param manager 地理围栏管理类
|
|
156
|
+
* @param location 定位结果,参考BMKLocation。
|
|
157
|
+
* @param error 错误信息
|
|
158
|
+
*/
|
|
159
|
+
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didUpdateLocation:(BMKLocation * _Nullable)location orError:(NSError * _Nullable)error;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @brief 当定位发生错误时,会调用代理的此方法。
|
|
163
|
+
* @param manager BMKGeoFenceManager 类。
|
|
164
|
+
* @param error 返回的错误,参考 CLError 。
|
|
165
|
+
*/
|
|
166
|
+
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didFailWithError:(NSError * _Nullable)error;
|
|
167
|
+
@end
|
|
168
|
+
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKGeoFenceRegion.h
|
|
3
|
+
// BMKLocationKit
|
|
4
|
+
//
|
|
5
|
+
// Created by baidu on 2017/3/2.
|
|
6
|
+
// Copyright © 2017年 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import <CoreLocation/CoreLocation.h>
|
|
11
|
+
#import "BMKLocationManager.h"
|
|
12
|
+
|
|
13
|
+
///BMKGeoFence Region State
|
|
14
|
+
typedef NS_ENUM(NSInteger, BMKGeoFenceRegionStatus)
|
|
15
|
+
{
|
|
16
|
+
BMKGeoFenceRegionStatusUnknown = 0, ///< 未知
|
|
17
|
+
BMKGeoFenceRegionStatusInside = 1, ///< 在范围内
|
|
18
|
+
BMKGeoFenceRegionStatusOutside = 1 << 1, ///< 在范围外
|
|
19
|
+
BMKGeoFenceRegionStatusStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
#pragma mark - BMKGeoFenceRegion
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
///地理围栏基类,不可直接使用
|
|
26
|
+
@interface BMKGeoFenceRegion : NSObject<NSCopying>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
///BMKGeoFenceRegion的唯一标识符
|
|
30
|
+
@property (nonatomic, copy, readonly) NSString *identifier;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
///用户自定义ID,可为nil。
|
|
34
|
+
@property (nonatomic, copy, readonly) NSString *customID;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
///坐标点和围栏的关系,比如用户的位置和围栏的关系
|
|
38
|
+
@property (nonatomic, assign) BMKGeoFenceRegionStatus fenceStatus;
|
|
39
|
+
|
|
40
|
+
///设定围栏坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
|
|
41
|
+
@property(nonatomic, readonly) BMKLocationCoordinateType coordinateType;
|
|
42
|
+
|
|
43
|
+
///上次发生状态变化的时间
|
|
44
|
+
@property(nonatomic, assign)NSTimeInterval lastEventTime;
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief 判断位置与围栏状态
|
|
49
|
+
* @param CLLocationCoordinate2D 坐标值
|
|
50
|
+
* @return 返回BMKGeoFenceRegionStatus状态
|
|
51
|
+
*/
|
|
52
|
+
-(BMKGeoFenceRegionStatus)judgeStatusWithCoor:(CLLocationCoordinate2D)coor;
|
|
53
|
+
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
#pragma mark - BMKLocationCircleRegion
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
///圆形地理围栏
|
|
61
|
+
@interface BMKGeoFenceCircleRegion : BMKGeoFenceRegion
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
///中心点的经纬度坐标
|
|
65
|
+
@property (nonatomic, readonly) CLLocationCoordinate2D center;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
///半径,单位:米
|
|
69
|
+
@property (nonatomic, readonly) CLLocationDistance radius;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief 构造圆形围栏
|
|
73
|
+
* @param customid 用户自定义ID
|
|
74
|
+
* @param identityid 识别id
|
|
75
|
+
* @param center 中心坐标
|
|
76
|
+
* @param radius 围栏半径
|
|
77
|
+
* @param type 坐标系类型
|
|
78
|
+
* @return BMKGeoFenceCircleRegion id
|
|
79
|
+
*/
|
|
80
|
+
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid center:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coor:(BMKLocationCoordinateType)type;
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@end
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
#pragma mark -BMKGeoFencePolygonRegion
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
///多边形地理围栏
|
|
91
|
+
@interface BMKGeoFencePolygonRegion : BMKGeoFenceRegion
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
///经纬度坐标点数据
|
|
95
|
+
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates;
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
///经纬度坐标点的个数
|
|
99
|
+
@property (nonatomic, readonly) NSInteger count;
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @brief 构造多边形围栏
|
|
104
|
+
* @param customid 用户自定义ID
|
|
105
|
+
* @param identityid 识别id
|
|
106
|
+
* @param coor 多边形顶点
|
|
107
|
+
* @param count 顶点个数
|
|
108
|
+
* @param type 坐标系类型
|
|
109
|
+
* @return BMKGeoFencePolygonRegion id
|
|
110
|
+
*/
|
|
111
|
+
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid coor:(CLLocationCoordinate2D *)coor count:(NSInteger)count coor:(BMKLocationCoordinateType)type;
|
|
112
|
+
|
|
113
|
+
@end
|
|
114
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKLocation.h
|
|
3
|
+
// LocationComponent
|
|
4
|
+
//
|
|
5
|
+
// Created by baidu on 2017/8/16.
|
|
6
|
+
// Copyright © 2017年 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef BMKLocation_h
|
|
10
|
+
#define BMKLocation_h
|
|
11
|
+
|
|
12
|
+
#import <CoreLocation/CoreLocation.h>
|
|
13
|
+
#import "BMKLocationReGeocode.h"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* BMKLocationProvider 位置数据来源,分iOS系统定位和其他定位服务结果两种,目前仅支持iOS系统定位服务
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
typedef NS_ENUM(int, BMKLocationProvider) {
|
|
20
|
+
|
|
21
|
+
BMKLocationProviderIOS = 0, //!<位置来源于iOS本身定位
|
|
22
|
+
BMKLocationProviderOther //!<位置来源于其他定位服务
|
|
23
|
+
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* BMKMockLocationProbability 位置数据为作弊定位的概率
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
typedef NS_ENUM(int, BMKMockLocationProbability) {
|
|
31
|
+
|
|
32
|
+
BMKMockLocationProbabilityNone = 0, //!<作弊概率为0
|
|
33
|
+
BMKMockLocationProbabilityLow, //!<低概率
|
|
34
|
+
BMKMockLocationProbabilityMid, //!<中概率
|
|
35
|
+
BMKMockLocationProbabilityHigh //!<高概率
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
///描述百度iOS 定位数据
|
|
39
|
+
@interface BMKLocation : NSObject
|
|
40
|
+
|
|
41
|
+
///BMKLocation 位置数据
|
|
42
|
+
@property(nonatomic, copy, readonly) CLLocation * _Nullable location;
|
|
43
|
+
|
|
44
|
+
///BMKLocation 地址数据
|
|
45
|
+
@property(nonatomic, copy) BMKLocationReGeocode * _Nullable rgcData;
|
|
46
|
+
|
|
47
|
+
///BMKLocation 位置来源
|
|
48
|
+
@property(nonatomic, assign) BMKLocationProvider provider;
|
|
49
|
+
|
|
50
|
+
///BMKLocation 位置ID
|
|
51
|
+
@property(nonatomic, retain) NSString * _Nullable locationID;
|
|
52
|
+
|
|
53
|
+
///BMKLocation 位置作弊概率
|
|
54
|
+
@property(nonatomic, assign) BMKMockLocationProbability mockProbability;
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* floorString
|
|
58
|
+
*
|
|
59
|
+
* Discussion:
|
|
60
|
+
* 室内定位成功时返回的楼层信息,ex:f1
|
|
61
|
+
*/
|
|
62
|
+
@property(readonly, nonatomic, copy, nullable) NSString *floorString;
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* buildingID
|
|
66
|
+
*
|
|
67
|
+
* Discussion:
|
|
68
|
+
* 室内定位成功时返回的百度建筑物ID
|
|
69
|
+
*/
|
|
70
|
+
@property(readonly, nonatomic, copy, nullable) NSString *buildingID;
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
* buildingName
|
|
74
|
+
*
|
|
75
|
+
* Discussion:
|
|
76
|
+
* 室内定位成功时返回的百度建筑物名称
|
|
77
|
+
*/
|
|
78
|
+
@property(readonly, nonatomic, copy, nullable) NSString *buildingName;
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* extraInfo
|
|
83
|
+
*
|
|
84
|
+
* Discussion:
|
|
85
|
+
* 定位附加信息,如停车位code识别结果、停车位code示例、vdr推算结果置信度等
|
|
86
|
+
*/
|
|
87
|
+
@property(readonly, nonatomic, copy, nullable) NSDictionary * extraInfo;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @brief 初始化BMKLocation实例
|
|
91
|
+
* @param loc CLLocation对象
|
|
92
|
+
* @param rgc BMKLocationReGeocode对象
|
|
93
|
+
* @return BMKLocation id
|
|
94
|
+
*/
|
|
95
|
+
- (id _Nonnull)initWithLocation:(CLLocation * _Nullable)loc withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @brief 构造BMKLocation
|
|
99
|
+
* @param location CLLocation
|
|
100
|
+
* @param floorString 楼层字符串
|
|
101
|
+
* @param buildingID 建筑物ID
|
|
102
|
+
* @param buildingName 建筑物名称
|
|
103
|
+
* @param info 位置附加信息
|
|
104
|
+
* @return BMKLocation id
|
|
105
|
+
*/
|
|
106
|
+
-(id _Nonnull)initWithLocation:(CLLocation * _Nullable)location floorString:(NSString * _Nullable)floorString buildingID:(NSString * _Nullable)buildingID
|
|
107
|
+
buildingName:(NSString * _Nullable)buildingName extraInfo:(NSDictionary * _Nullable)info withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@end
|
|
111
|
+
|
|
112
|
+
#endif /* BMKLocation_h */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKLocationAuth.h
|
|
3
|
+
// LocationComponent
|
|
4
|
+
//
|
|
5
|
+
// Created by baidu on 2017/4/10.
|
|
6
|
+
// Copyright © 2017年 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef BMKLocationAuth_h
|
|
10
|
+
#define BMKLocationAuth_h
|
|
11
|
+
|
|
12
|
+
///定位鉴权错误码
|
|
13
|
+
typedef NS_ENUM(NSInteger, BMKLocationAuthErrorCode) {
|
|
14
|
+
BMKLocationAuthErrorUnknown = -1, ///< 未知错误
|
|
15
|
+
BMKLocationAuthErrorSuccess = 0, ///< 鉴权成功
|
|
16
|
+
BMKLocationAuthErrorNetworkFailed = 1, ///< 因网络鉴权失败
|
|
17
|
+
BMKLocationAuthErrorFailed = 2, ///< KEY非法鉴权失败
|
|
18
|
+
|
|
19
|
+
};
|
|
20
|
+
///通知Delegate
|
|
21
|
+
@protocol BMKLocationAuthDelegate <NSObject>
|
|
22
|
+
@optional
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*@brief 返回授权验证错误
|
|
26
|
+
*@param iError 错误号 : 为0时验证通过,具体参加BMKLocationAuthErrorCode
|
|
27
|
+
*/
|
|
28
|
+
- (void)onCheckPermissionState:(BMKLocationAuthErrorCode)iError;
|
|
29
|
+
@end
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
///BMKLocationAuth类。用于鉴权
|
|
33
|
+
@interface BMKLocationAuth : NSObject
|
|
34
|
+
|
|
35
|
+
///鉴权状态0:成功; 1:网络错误; 2:授权失败
|
|
36
|
+
@property(nonatomic, readonly, assign) BMKLocationAuthErrorCode permisionState __deprecated_msg("已废弃since 2.0.5");
|
|
37
|
+
|
|
38
|
+
///是否同意隐私合规政策
|
|
39
|
+
@property(nonatomic, readonly, assign) BOOL isAgreePrivacy;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @brief 得到BMKLocationAuth的单例
|
|
43
|
+
*/
|
|
44
|
+
+ (BMKLocationAuth*)sharedInstance;
|
|
45
|
+
|
|
46
|
+
/// 地图开放平台使用到的唯一标识符,since 2.1.0
|
|
47
|
+
+ (NSString *)getCUID;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*@brief 启动引擎
|
|
51
|
+
*@param key 申请的有效key
|
|
52
|
+
*@param delegate 回调是否鉴权成功
|
|
53
|
+
*/
|
|
54
|
+
-(void)checkPermisionWithKey:(NSString*)key authDelegate:(id<BMKLocationAuthDelegate>)delegate;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
*@brief 更新是否同意隐私合格政策需要在BMKLocationManager和BMKGeoFenceManager实例化之前调用,否则实例化失败,定位功能不可用。
|
|
59
|
+
* 在使用BMKLocationManager和BMKGeoFenceManager时,请注意需要加判空处理。
|
|
60
|
+
* 隐私政策官网链接:https://lbsyun.baidu.com/index.php?title=openprivacy
|
|
61
|
+
*
|
|
62
|
+
* note:隐私政策变更后需要重新初始化BMKLocationManager或BMKGeoFenceManager
|
|
63
|
+
*@param agreePrivacy 是否同意
|
|
64
|
+
*/
|
|
65
|
+
- (void)setAgreePrivacy:(BOOL)agreePrivacy;
|
|
66
|
+
|
|
67
|
+
@end
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
#endif /* BMKLocationAuth_h */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKLocationComponent.h
|
|
3
|
+
// LocationComponent
|
|
4
|
+
//
|
|
5
|
+
// Created by Baidu on 3/31/14.
|
|
6
|
+
// Copyright (c) 2014 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "BMKLocationManager.h"
|
|
10
|
+
#import "BMKLocationKitVersion.h"
|
|
11
|
+
#import "BMKLocationPoi.h"
|
|
12
|
+
#import "BMKLocation.h"
|
|
13
|
+
#import "BMKGeoFenceRegion.h"
|
|
14
|
+
#import "BMKGeoFenceManager.h"
|
|
15
|
+
#import "BMKLocationReGeocode.h"
|
|
16
|
+
#import "BMKLocationAuth.h"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// BMKLocationKitVersion.h
|
|
3
|
+
// BMKLocationKit
|
|
4
|
+
//
|
|
5
|
+
// Created by baidu on 17/9/9.
|
|
6
|
+
// Copyright © 2017年 baidu. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef BMKLocationKitVersion_h
|
|
10
|
+
#define BMKLocationKitVersion_h
|
|
11
|
+
|
|
12
|
+
#import <UIKit/UIKit.h>
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*获取当前定位sdk 的版本号
|
|
16
|
+
*当前定位sdk版本 : 2.1.3
|
|
17
|
+
*@return 返回当前定位sdk 的版本号
|
|
18
|
+
*/
|
|
19
|
+
UIKIT_EXTERN NSString* BMKLocationKitVersion();
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*获取当前定位sdk 的float版本号
|
|
23
|
+
*当前定位sdk版本 : 2.13
|
|
24
|
+
*@return 返回当前定位sdk 的float版本号
|
|
25
|
+
*/
|
|
26
|
+
UIKIT_EXTERN float BMKLocationKitFloatVersion();
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
#endif /* BMKLocationKitVersion_h */
|