@wayq/beekon-rn 0.0.3 → 0.0.6
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/BeekonRn.podspec +5 -3
- package/CHANGELOG.md +103 -0
- package/README.md +326 -52
- package/android/build.gradle +9 -4
- package/android/src/main/java/in/wayq/beekonrn/BeekonRnModule.kt +411 -59
- package/ios/BeekonRn.mm +103 -24
- package/ios/BeekonRn.swift +465 -61
- package/ios/Frameworks/BeekonKit.xcframework/Info.plist +5 -5
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.abi.json +11424 -1279
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios.swiftinterface +262 -36
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/BeekonKit +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Info.plist +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.abi.json +11424 -1279
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +262 -36
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.abi.json +11424 -1279
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/Modules/BeekonKit.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +262 -36
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64_x86_64-simulator/BeekonKit.framework/_CodeSignature/CodeResources +2 -80
- package/lib/module/NativeBeekonRn.js +35 -7
- package/lib/module/NativeBeekonRn.js.map +1 -1
- package/lib/module/beekon.js +246 -45
- package/lib/module/beekon.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/mappers.js +166 -25
- package/lib/module/internal/mappers.js.map +1 -1
- package/lib/module/types/auth.js +4 -0
- package/lib/module/types/auth.js.map +1 -0
- package/lib/module/types/config.js +2 -0
- package/lib/module/types/enums.js +2 -0
- package/lib/module/types/enums.js.map +1 -0
- package/lib/module/types/error.js +20 -4
- package/lib/module/types/error.js.map +1 -1
- package/lib/module/types/geofence.js +2 -0
- package/lib/module/types/geofence.js.map +1 -0
- package/lib/module/types/location.js +2 -0
- package/lib/module/types/sync.js +2 -0
- package/lib/module/types/sync.js.map +1 -0
- package/lib/typescript/src/NativeBeekonRn.d.ts +150 -20
- package/lib/typescript/src/NativeBeekonRn.d.ts.map +1 -1
- package/lib/typescript/src/beekon.d.ts +110 -33
- package/lib/typescript/src/beekon.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/internal/mappers.d.ts +16 -6
- package/lib/typescript/src/internal/mappers.d.ts.map +1 -1
- package/lib/typescript/src/types/auth.d.ts +99 -0
- package/lib/typescript/src/types/auth.d.ts.map +1 -0
- package/lib/typescript/src/types/config.d.ts +66 -20
- package/lib/typescript/src/types/config.d.ts.map +1 -1
- package/lib/typescript/src/types/enums.d.ts +62 -0
- package/lib/typescript/src/types/enums.d.ts.map +1 -0
- package/lib/typescript/src/types/error.d.ts +21 -5
- package/lib/typescript/src/types/error.d.ts.map +1 -1
- package/lib/typescript/src/types/geofence.d.ts +36 -0
- package/lib/typescript/src/types/geofence.d.ts.map +1 -0
- package/lib/typescript/src/types/location.d.ts +22 -8
- package/lib/typescript/src/types/location.d.ts.map +1 -1
- package/lib/typescript/src/types/state.d.ts +13 -4
- package/lib/typescript/src/types/state.d.ts.map +1 -1
- package/lib/typescript/src/types/sync.d.ts +27 -0
- package/lib/typescript/src/types/sync.d.ts.map +1 -0
- package/package.json +8 -5
- package/scripts/fetch-beekonkit.sh +5 -5
- package/src/NativeBeekonRn.ts +165 -20
- package/src/beekon.ts +278 -48
- package/src/index.tsx +24 -2
- package/src/internal/mappers.ts +242 -27
- package/src/types/auth.ts +101 -0
- package/src/types/config.ts +68 -20
- package/src/types/enums.ts +80 -0
- package/src/types/error.ts +23 -5
- package/src/types/geofence.ts +37 -0
- package/src/types/location.ts +28 -8
- package/src/types/state.ts +13 -3
- package/src/types/sync.ts +23 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeResources +0 -296
- package/ios/Frameworks/BeekonKit.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/Frameworks/BeekonKit.xcframework/ios-arm64/BeekonKit.framework/_CodeSignature/CodeResources +0 -146
package/ios/BeekonRn.mm
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
#import "BeekonRn.h"
|
|
2
|
-
// Auto-generated
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// Auto-generated Swift interop header for the BeekonRnImpl class. Its path
|
|
3
|
+
// depends on how the host links pods: under `<BeekonRn/…>` with
|
|
4
|
+
// `use_frameworks!` (framework), or as a same-target generated header with
|
|
5
|
+
// static linking (the React Native default). Support both.
|
|
6
|
+
#if __has_include(<BeekonRn/BeekonRn-Swift.h>)
|
|
5
7
|
#import <BeekonRn/BeekonRn-Swift.h>
|
|
8
|
+
#else
|
|
9
|
+
#import "BeekonRn-Swift.h"
|
|
10
|
+
#endif
|
|
6
11
|
|
|
7
12
|
@implementation BeekonRn {
|
|
8
13
|
BeekonRnImpl *_impl;
|
|
@@ -13,32 +18,46 @@
|
|
|
13
18
|
if (self) {
|
|
14
19
|
__weak __typeof(self) weakSelf = self;
|
|
15
20
|
_impl = [[BeekonRnImpl alloc]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
initOnState:^(NSDictionary *_Nonnull s) {
|
|
22
|
+
[weakSelf emitOnState:s];
|
|
23
|
+
}
|
|
24
|
+
onLocation:^(NSDictionary *_Nonnull l) {
|
|
25
|
+
[weakSelf emitOnLocation:l];
|
|
26
|
+
}
|
|
27
|
+
onGeofenceEvent:^(NSDictionary *_Nonnull e) {
|
|
28
|
+
[weakSelf emitOnGeofenceEvent:e];
|
|
29
|
+
}
|
|
30
|
+
onSyncStatus:^(NSDictionary *_Nonnull st) {
|
|
31
|
+
[weakSelf emitOnSyncStatus:st];
|
|
32
|
+
}
|
|
33
|
+
onAuthTokens:^(NSDictionary *_Nonnull t) {
|
|
34
|
+
[weakSelf emitOnAuthTokens:t];
|
|
35
|
+
}];
|
|
22
36
|
}
|
|
23
37
|
return self;
|
|
24
38
|
}
|
|
25
39
|
|
|
40
|
+
// Called by React Native on teardown (RCTInvalidating). The Codegen base class
|
|
41
|
+
// derives from NSObject, which has no `invalidate`, so there's no super to call.
|
|
26
42
|
- (void)invalidate {
|
|
27
43
|
[_impl invalidate];
|
|
28
|
-
[super invalidate];
|
|
29
44
|
}
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
/// Registers Beekon's background tasks. Call from the host AppDelegate's
|
|
47
|
+
/// `application:didFinishLaunchingWithOptions:` (it must run before that method
|
|
48
|
+
/// returns). Exposed as a class method so hosts don't import BeekonKit directly.
|
|
49
|
+
+ (void)registerBackgroundTasks {
|
|
50
|
+
[BeekonRnImpl registerBackgroundTasks];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// MARK: - Lifecycle
|
|
54
|
+
|
|
55
|
+
- (void)configure:(NSDictionary *)config
|
|
32
56
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
33
57
|
reject:(RCTPromiseRejectBlock)reject {
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
NSDictionary *dict = @{
|
|
38
|
-
@"intervalSeconds": @(config.intervalSeconds()),
|
|
39
|
-
@"distanceMeters": @(config.distanceMeters()),
|
|
40
|
-
};
|
|
41
|
-
[_impl configure:dict resolver:resolve rejecter:reject];
|
|
58
|
+
// The config crosses as a plain dictionary (UnsafeObject); the Swift side
|
|
59
|
+
// parses it. iOS ignores `notification` (Android-only).
|
|
60
|
+
[_impl configure:config resolver:resolve rejecter:reject];
|
|
42
61
|
}
|
|
43
62
|
|
|
44
63
|
- (void)start:(RCTPromiseResolveBlock)resolve
|
|
@@ -51,11 +70,71 @@
|
|
|
51
70
|
[_impl stopWithResolver:resolve rejecter:reject];
|
|
52
71
|
}
|
|
53
72
|
|
|
54
|
-
- (void)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
- (void)resumeIfNeeded:(RCTPromiseResolveBlock)resolve
|
|
74
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
75
|
+
[_impl resumeIfNeededWithResolver:resolve rejecter:reject];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
- (void)getCurrentLocation:(double)timeoutMs
|
|
79
|
+
accuracy:(NSString *)accuracy
|
|
80
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
81
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
82
|
+
[_impl getCurrentLocationTimeoutMs:timeoutMs
|
|
83
|
+
accuracy:accuracy
|
|
84
|
+
resolver:resolve
|
|
85
|
+
rejecter:reject];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// MARK: - History
|
|
89
|
+
|
|
90
|
+
- (void)getLocations:(double)fromMs
|
|
91
|
+
toMs:(double)toMs
|
|
92
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
93
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
94
|
+
[_impl getLocationsFromMs:fromMs toMs:toMs resolver:resolve rejecter:reject];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
- (void)deleteLocations:(double)beforeMs
|
|
98
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
99
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
100
|
+
[_impl deleteLocationsBeforeMs:beforeMs resolver:resolve rejecter:reject];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (void)pendingUploadCount:(RCTPromiseResolveBlock)resolve
|
|
104
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
105
|
+
[_impl pendingUploadCountWithResolver:resolve rejecter:reject];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// MARK: - Sync
|
|
109
|
+
|
|
110
|
+
- (void)sync:(RCTPromiseResolveBlock)resolve
|
|
111
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
112
|
+
[_impl syncWithResolver:resolve rejecter:reject];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
- (void)setExtras:(NSArray *)entries
|
|
116
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
117
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
118
|
+
[_impl setExtras:entries resolver:resolve rejecter:reject];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// MARK: - Geofences
|
|
122
|
+
|
|
123
|
+
- (void)addGeofences:(NSArray *)geofences
|
|
124
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
125
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
126
|
+
[_impl addGeofences:geofences resolver:resolve rejecter:reject];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
- (void)removeGeofences:(NSArray *)ids
|
|
130
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
131
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
132
|
+
[_impl removeGeofences:ids resolver:resolve rejecter:reject];
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
- (void)listGeofences:(RCTPromiseResolveBlock)resolve
|
|
136
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
137
|
+
[_impl listGeofencesWithResolver:resolve rejecter:reject];
|
|
59
138
|
}
|
|
60
139
|
|
|
61
140
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|