@rodrigo7/react-native-beacons-manager 1.0.0 → 1.0.1
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/.eslintrc.js +4 -0
- package/ReactNativeBeaconsManager.podspec +1 -1
- package/android/.gradle/8.0.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/.project +1 -2
- package/android/build.gradle +7 -7
- package/android/local.properties +8 -0
- package/android/src/main/java/com/mackentoch/beaconsandroid/BeaconsAndroidModule.java +1 -58
- package/package.json +13 -11
- package/typings/index.d.ts +1 -1
- package/typings.json +1 -1
package/.eslintrc.js
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = "ReactNativeBeaconsManager"
|
|
3
|
-
s.version = "1.0.
|
|
3
|
+
s.version = "1.0.1"
|
|
4
4
|
s.summary = "React-Native library for detecting beacons (iOS and Android)"
|
|
5
5
|
s.homepage = "https://github.com/rodrigo-nexudus/react-native-beacons-manager#readme"
|
|
6
6
|
s.license = { :type => "MIT" }
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GradleSettings">
|
|
4
|
+
<option name="linkedExternalProjectsSettings">
|
|
5
|
+
<GradleProjectSettings>
|
|
6
|
+
<option name="testRunner" value="GRADLE" />
|
|
7
|
+
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
8
|
+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
9
|
+
</GradleProjectSettings>
|
|
10
|
+
</option>
|
|
11
|
+
</component>
|
|
12
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="Embedded JDK" project-jdk-type="JavaSDK">
|
|
5
|
+
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="ProjectType">
|
|
8
|
+
<option name="id" value="Android" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
package/android/.project
CHANGED
package/android/build.gradle
CHANGED
|
@@ -5,16 +5,16 @@ buildscript {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
|
-
|
|
8
|
+
classpath("com.android.tools.build:gradle")
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
apply plugin: 'com.android.library'
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
16
|
-
def DEFAULT_BUILD_TOOLS_VERSION = "
|
|
17
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
15
|
+
def DEFAULT_COMPILE_SDK_VERSION = 33
|
|
16
|
+
def DEFAULT_BUILD_TOOLS_VERSION = "33.0.2"
|
|
17
|
+
def DEFAULT_TARGET_SDK_VERSION = 33
|
|
18
18
|
|
|
19
19
|
android {
|
|
20
20
|
compileSdkVersion project.hasProperty('compileSdkVersion') ? project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
|
|
@@ -23,8 +23,8 @@ android {
|
|
|
23
23
|
defaultConfig {
|
|
24
24
|
minSdkVersion 16
|
|
25
25
|
targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
|
26
|
-
versionCode
|
|
27
|
-
versionName "1.0"
|
|
26
|
+
versionCode 2
|
|
27
|
+
versionName "1.0.1"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -103,6 +103,6 @@ repositories {
|
|
|
103
103
|
dependencies {
|
|
104
104
|
//noinspection GradleDynamicVersion
|
|
105
105
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
106
|
-
implementation 'com.facebook.react:react-native:0.
|
|
106
|
+
implementation 'com.facebook.react:react-native:0.72.3'
|
|
107
107
|
implementation 'org.altbeacon:android-beacon-library:2.19.6'
|
|
108
108
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Thu Aug 03 10:59:00 BST 2023
|
|
8
|
+
sdk.dir=/Users/nexudus/Library/Android/sdk
|
|
@@ -54,10 +54,6 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
54
54
|
this.mBeaconManager = BeaconManager.getInstanceForApplication(mApplicationContext);
|
|
55
55
|
this.mBeaconManager.addRangeNotifier(mRangeNotifier);
|
|
56
56
|
this.mBeaconManager.addMonitorNotifier(mMonitorNotifier);
|
|
57
|
-
// need to bind at instantiation so that service loads (to test more)
|
|
58
|
-
//mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));
|
|
59
|
-
|
|
60
|
-
//mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"));
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
@Override
|
|
@@ -83,27 +79,11 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
83
79
|
Beacon.setHardwareEqualityEnforced(e.booleanValue());
|
|
84
80
|
}
|
|
85
81
|
|
|
86
|
-
/*public void bindManager() {
|
|
87
|
-
if (!mBeaconManager.isBound(this)) {
|
|
88
|
-
Log.d(LOG_TAG, "BeaconsAndroidModule - bindManager: ");
|
|
89
|
-
mBeaconManager.bind(this);
|
|
90
|
-
}
|
|
91
|
-
}*/
|
|
92
|
-
|
|
93
|
-
/*public void unbindManager() {
|
|
94
|
-
if (mBeaconManager.isBound(this)) {
|
|
95
|
-
Log.d(LOG_TAG, "BeaconsAndroidModule - unbindManager: ");
|
|
96
|
-
mBeaconManager.unbind(this);
|
|
97
|
-
}
|
|
98
|
-
}*/
|
|
99
|
-
|
|
100
82
|
@ReactMethod
|
|
101
83
|
public void addParser(String parser, Callback resolve, Callback reject) {
|
|
102
84
|
try {
|
|
103
85
|
Log.d(LOG_TAG, "BeaconsAndroidModule - addParser: " + parser);
|
|
104
|
-
//unbindManager();
|
|
105
86
|
mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout(parser));
|
|
106
|
-
//bindManager();
|
|
107
87
|
resolve.invoke();
|
|
108
88
|
} catch (Exception e) {
|
|
109
89
|
reject.invoke(e.getMessage());
|
|
@@ -114,9 +94,7 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
114
94
|
public void removeParser(String parser, Callback resolve, Callback reject) {
|
|
115
95
|
try {
|
|
116
96
|
Log.d(LOG_TAG, "BeaconsAndroidModule - removeParser: " + parser);
|
|
117
|
-
//unbindManager();
|
|
118
97
|
mBeaconManager.getBeaconParsers().remove(new BeaconParser().setBeaconLayout(parser));
|
|
119
|
-
//bindManager();
|
|
120
98
|
resolve.invoke();
|
|
121
99
|
} catch (Exception e) {
|
|
122
100
|
reject.invoke(e.getMessage());
|
|
@@ -126,13 +104,11 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
126
104
|
@ReactMethod
|
|
127
105
|
public void addParsersListToDetection(ReadableArray parsers, Callback resolve, Callback reject) {
|
|
128
106
|
try {
|
|
129
|
-
//unbindManager();
|
|
130
107
|
for (int i = 0; i < parsers.size(); i++) {
|
|
131
108
|
String parser = parsers.getString(i);
|
|
132
109
|
Log.d(LOG_TAG, "addParsersListToDetection - add parser: " + parser);
|
|
133
110
|
mBeaconManager.getBeaconParsers().add(new BeaconParser().setBeaconLayout(parser));
|
|
134
111
|
}
|
|
135
|
-
//bindManager();
|
|
136
112
|
resolve.invoke(parsers);
|
|
137
113
|
} catch (Exception e) {
|
|
138
114
|
reject.invoke(e.getMessage());
|
|
@@ -142,13 +118,11 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
142
118
|
@ReactMethod
|
|
143
119
|
public void removeParsersListToDetection(ReadableArray parsers, Callback resolve, Callback reject) {
|
|
144
120
|
try {
|
|
145
|
-
//unbindManager();
|
|
146
121
|
for (int i = 0; i < parsers.size(); i++) {
|
|
147
122
|
String parser = parsers.getString(i);
|
|
148
123
|
Log.d(LOG_TAG, "removeParsersListToDetection - remove parser: " + parser);
|
|
149
124
|
mBeaconManager.getBeaconParsers().remove(new BeaconParser().setBeaconLayout(parser));
|
|
150
125
|
}
|
|
151
|
-
//bindManager();
|
|
152
126
|
resolve.invoke(parsers);
|
|
153
127
|
} catch (Exception e) {
|
|
154
128
|
reject.invoke(e.getMessage());
|
|
@@ -208,7 +182,7 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
208
182
|
for (Region region: mBeaconManager.getMonitoredRegions()) {
|
|
209
183
|
WritableMap map = new WritableNativeMap();
|
|
210
184
|
map.putString("identifier", region.getUniqueId());
|
|
211
|
-
map.putString("uuid", region.getId1().toString());
|
|
185
|
+
map.putString("uuid", region.getId1() != null ? region.getId1().toString() : "");
|
|
212
186
|
map.putInt("major", region.getId2() != null ? region.getId2().toInt() : 0);
|
|
213
187
|
map.putInt("minor", region.getId3() != null ? region.getId3().toInt() : 0);
|
|
214
188
|
array.pushMap(map);
|
|
@@ -228,36 +202,6 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
228
202
|
callback.invoke(array);
|
|
229
203
|
}
|
|
230
204
|
|
|
231
|
-
/***********************************************************************************************
|
|
232
|
-
* BeaconConsumer
|
|
233
|
-
**********************************************************************************************/
|
|
234
|
-
/*@Override
|
|
235
|
-
public void onBeaconServiceConnect() {
|
|
236
|
-
Log.v(LOG_TAG, "onBeaconServiceConnect");
|
|
237
|
-
|
|
238
|
-
// deprecated since v2.9 (see github: https://github.com/AltBeacon/android-beacon-library/releases/tag/2.9)
|
|
239
|
-
// mBeaconManager.setMonitorNotifier(mMonitorNotifier);
|
|
240
|
-
// mBeaconManager.setRangeNotifier(mRangeNotifier);
|
|
241
|
-
mBeaconManager.addMonitorNotifier(mMonitorNotifier);
|
|
242
|
-
mBeaconManager.addRangeNotifier(mRangeNotifier);
|
|
243
|
-
sendEvent(mReactContext, "beaconServiceConnected", null);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
@Override
|
|
247
|
-
public Context getApplicationContext() {
|
|
248
|
-
return mApplicationContext;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
@Override
|
|
252
|
-
public void unbindService(ServiceConnection serviceConnection) {
|
|
253
|
-
mApplicationContext.unbindService(serviceConnection);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
@Override
|
|
257
|
-
public boolean bindService(Intent intent, ServiceConnection serviceConnection, int i) {
|
|
258
|
-
return mApplicationContext.bindService(intent, serviceConnection, i);
|
|
259
|
-
}*/
|
|
260
|
-
|
|
261
205
|
/***********************************************************************************************
|
|
262
206
|
* Monitoring
|
|
263
207
|
**********************************************************************************************/
|
|
@@ -271,7 +215,6 @@ public class BeaconsAndroidModule extends ReactContextBaseJavaModule {
|
|
|
271
215
|
String.valueOf(minor).equals("-1") ? "" : String.valueOf(minor),
|
|
272
216
|
String.valueOf(major).equals("-1") ? "" : String.valueOf(major)
|
|
273
217
|
);
|
|
274
|
-
//mBeaconManager.startMonitoringBeaconsInRegion(region);
|
|
275
218
|
mBeaconManager.startMonitoring(region);
|
|
276
219
|
resolve.invoke();
|
|
277
220
|
} catch (Exception e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rodrigo7/react-native-beacons-manager",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "React-Native library for detecting beacons (iOS and Android)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -47,16 +47,18 @@
|
|
|
47
47
|
"license": "MIT",
|
|
48
48
|
"nativePackage": true,
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"babel
|
|
51
|
-
"babel-
|
|
52
|
-
"
|
|
53
|
-
"eslint
|
|
54
|
-
"eslint-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
50
|
+
"@babel/core": "^7.20.0",
|
|
51
|
+
"@babel/preset-env": "^7.20.0",
|
|
52
|
+
"@babel/runtime": "^7.20.0",
|
|
53
|
+
"eslint": "^8.19.0",
|
|
54
|
+
"@react-native/eslint-config": "^0.72.2",
|
|
55
|
+
"@react-native/metro-config": "^0.72.9",
|
|
56
|
+
"@tsconfig/react-native": "^3.0.0",
|
|
57
|
+
"metro-react-native-babel-preset": "0.76.7",
|
|
58
|
+
"prettier": "^2.4.1",
|
|
59
|
+
"typescript": "4.8.4",
|
|
60
|
+
"react": "^18.2.0",
|
|
61
|
+
"react-native": "^0.72.3"
|
|
60
62
|
},
|
|
61
63
|
"peerDependencies": {
|
|
62
64
|
"react": ">=15.4.2",
|
package/typings/index.d.ts
CHANGED
package/typings.json
CHANGED