@rodrigo7/react-native-beacons-manager 1.0.1 → 1.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/android/build.gradle +5 -5
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/mackentoch/beaconsandroid/BeaconsAndroidModule.java +1 -0
- package/ios/RNiBeacon/RNiBeacon/RNiBeacon.m +13 -7
- package/ios/RNiBeacon/RNiBeacon.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNiBeacon/RNiBeacon.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNiBeacon/RNiBeacon.xcodeproj/project.xcworkspace/xcuserdata/nexudus.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNiBeacon/RNiBeacon.xcodeproj/xcuserdata/nexudus.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +1 -1
- package/tsconfig.json +3 -0
- package/typings/index.d.ts +26 -29
- package/typings.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
buildscript {
|
|
2
2
|
repositories {
|
|
3
3
|
google()
|
|
4
|
-
|
|
4
|
+
mavenCentral()
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
|
-
classpath("com.android.tools.build:gradle")
|
|
8
|
+
classpath("com.android.tools.build:gradle:8.1.0")
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
apply plugin: 'com.android.library'
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
def DEFAULT_COMPILE_SDK_VERSION = 33
|
|
16
|
-
def DEFAULT_BUILD_TOOLS_VERSION = "33.0.
|
|
15
|
+
def DEFAULT_BUILD_TOOLS_VERSION = "33.0.0"
|
|
17
16
|
def DEFAULT_TARGET_SDK_VERSION = 33
|
|
18
17
|
|
|
19
18
|
android {
|
|
@@ -21,10 +20,11 @@ android {
|
|
|
21
20
|
buildToolsVersion project.hasProperty('buildToolsVersion') ? project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
|
|
22
21
|
|
|
23
22
|
defaultConfig {
|
|
23
|
+
namespace 'com.mackentoch.beaconsandroid'
|
|
24
24
|
minSdkVersion 16
|
|
25
25
|
targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
|
26
26
|
versionCode 2
|
|
27
|
-
versionName "1.0.
|
|
27
|
+
versionName "1.0.2"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
2
|
<uses-permission android:name="android.permission.BLUETOOTH"/>
|
|
3
3
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
|
|
4
4
|
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
|
|
@@ -384,6 +384,7 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
private Region createRegion(String regionId, String beaconUuid) {
|
|
387
|
+
Log.d(LOG_TAG, "Creating following region - Region Id: " + regionId + ", Beacon UUID: " + beaconUuid);
|
|
387
388
|
Identifier id1 = (beaconUuid == null) ? null : Identifier.parse(beaconUuid);
|
|
388
389
|
return new Region(regionId, id1, null, null);
|
|
389
390
|
}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
#import "RNiBeacon.h"
|
|
18
18
|
|
|
19
19
|
static NSString *const kEddystoneRegionID = @"EDDY_STONE_REGION_ID";
|
|
20
|
-
bool hasListeners = NO;
|
|
21
20
|
|
|
22
21
|
@interface RNiBeacon() <CLLocationManagerDelegate, ESSBeaconScannerDelegate>
|
|
23
22
|
|
|
@@ -28,16 +27,23 @@ bool hasListeners = NO;
|
|
|
28
27
|
@end
|
|
29
28
|
|
|
30
29
|
@implementation RNiBeacon
|
|
30
|
+
{
|
|
31
|
+
bool hasListeners;
|
|
32
|
+
}
|
|
31
33
|
|
|
32
34
|
// Will be called when this module's first listener is added.
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
+
-(void)startObserving {
|
|
36
|
+
hasListeners = YES;
|
|
37
|
+
// Set up any upstream listeners or background tasks as necessary
|
|
35
38
|
}
|
|
39
|
+
|
|
36
40
|
// Will be called when this module's last listener is removed, or on dealloc.
|
|
37
|
-
-
|
|
38
|
-
|
|
41
|
+
-(void)stopObserving {
|
|
42
|
+
hasListeners = NO;
|
|
43
|
+
// Remove upstream listeners, stop unnecessary background tasks
|
|
39
44
|
}
|
|
40
45
|
|
|
46
|
+
|
|
41
47
|
RCT_EXPORT_MODULE()
|
|
42
48
|
|
|
43
49
|
#pragma mark Initialization
|
|
@@ -358,8 +364,8 @@ RCT_EXPORT_METHOD(shouldDropEmptyRanges:(BOOL)drop)
|
|
|
358
364
|
@"beacons": beaconArray
|
|
359
365
|
};
|
|
360
366
|
|
|
361
|
-
if (self.bridge
|
|
362
|
-
|
|
367
|
+
if (self.bridge) {
|
|
368
|
+
[self.bridge.eventDispatcher sendDeviceEventWithName:@"beaconsDidRange" body:event];
|
|
363
369
|
}
|
|
364
370
|
}
|
|
365
371
|
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
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>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>RNiBeacon.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
package/package.json
CHANGED
package/tsconfig.json
ADDED
package/typings/index.d.ts
CHANGED
|
@@ -140,35 +140,32 @@ declare module '@rodrigo7/react-native-beacons-manager' {
|
|
|
140
140
|
const beacons: Beacons;
|
|
141
141
|
export default beacons;
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export type BeaconRangingResponse = {
|
|
168
|
-
beacons: Beacon[];
|
|
169
|
-
identifier: string;
|
|
170
|
-
uuid: string;
|
|
171
|
-
}
|
|
143
|
+
export interface BeaconRegion {
|
|
144
|
+
identifier: string,
|
|
145
|
+
uuid: string,
|
|
146
|
+
minor?: number,
|
|
147
|
+
major?: number
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type AuthorizationStatus =
|
|
151
|
+
| 'authorizedAlways'
|
|
152
|
+
| 'authorizedWhenInUse'
|
|
153
|
+
| 'denied'
|
|
154
|
+
| 'notDetermined'
|
|
155
|
+
| 'restricted';
|
|
156
|
+
|
|
157
|
+
export type Beacon = {
|
|
158
|
+
distance: number;
|
|
159
|
+
major: number;
|
|
160
|
+
minor: number;
|
|
161
|
+
proximity: 'immediate' | 'near' | 'far';
|
|
162
|
+
rssi: number;
|
|
163
|
+
uuid: string;
|
|
164
|
+
}
|
|
172
165
|
|
|
166
|
+
export type BeaconRangingResponse = {
|
|
167
|
+
beacons: Beacon[];
|
|
168
|
+
identifier: string;
|
|
169
|
+
uuid: string;
|
|
173
170
|
}
|
|
174
171
|
}
|