百度定位SDK for iOS v1.5 类参考
BMKGeoFenceManager.h
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 
11 @protocol BMKGeoFenceManagerDelegate;
12 
14 typedef NS_OPTIONS(NSUInteger, BMKGeoFenceActiveAction)
15 {
16  BMKGeoFenceActiveActionNone = 0,
17  BMKGeoFenceActiveActionInside = 1 << 0,
18  BMKGeoFenceActiveActionOutside = 1 << 1,
19  BMKGeoFenceActiveActionStayed = 1 << 2,
20 };
21 
23 FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKGeoFenceErrorDomain;
24 
26 typedef NS_ENUM(NSInteger, BMKGeoFenceErrorCode) {
27  BMKGeoFenceErrorUnknown = 1,
28  BMKGeoFenceErrorInvalidParameter = 2,
29  BMKGeoFenceErrorFailureConnection = 3,
30  BMKGeoFenceErrorFailureAuth = 4,
31  BMKGeoFenceErrorNoValidFence = 5,
32  BMKGeoFenceErroFailureLocating = 6,
33 };
34 
35 
37 @interface BMKGeoFenceManager : NSObject
38 
39 
41 @property (nonatomic, weak, nullable) id<BMKGeoFenceManagerDelegate> delegate;
42 
43 
45 @property (nonatomic, assign) BMKGeoFenceActiveAction activeAction;
46 
47 
49 @property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
50 
51 
53 @property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
54 
55 
63 - (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
64 
65 
73 - (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coordinates count:(NSInteger)count coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
74 
75 
81 - (NSArray * _Nullable)geoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
82 
83 
88 - (void)removeTheGeoFenceRegion:(BMKGeoFenceRegion * _Nonnull)region;
89 
90 
95 - (void)removeGeoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
96 
97 
102 
103 
104 @end
105 
106 
107 
109 @protocol BMKGeoFenceManagerDelegate <NSObject>
110 
111 @optional
112 
113 
121 - (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didAddRegionForMonitoringFinished:(NSArray <BMKGeoFenceRegion *> * _Nullable)regions customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
122 
123 
131 - (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didGeoFencesStatusChangedForRegion:(BMKGeoFenceRegion * _Nullable)region customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
132 
133 @end
134 
地理围栏基类,不可直接使用
Definition: BMKGeoFenceRegion.h:26
void removeAllGeoFenceRegions()
移除所有围栏
id< BMKGeoFenceManagerDelegate > delegate
实现了 BMKGeoFenceManagerDelegate 协议的类指针。
Definition: BMKGeoFenceManager.h:41
BOOL pausesLocationUpdatesAutomatically
指定定位是否会被系统自动暂停。默认为NO。
Definition: BMKGeoFenceManager.h:49
BMKGeoFenceActiveAction activeAction
需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。
Definition: BMKGeoFenceManager.h:45
BOOL allowsBackgroundLocationUpdates
是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Lo...
Definition: BMKGeoFenceManager.h:53
地理围栏管理类
Definition: BMKGeoFenceManager.h:37