@grouplinknetwork/rn-grouplink-sdk 2.4.0 → 2.5.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/android/build.gradle +8 -115
- package/android/src/main/AndroidManifest.xml +2 -3
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +111 -91
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkPackage.java +30 -14
- package/grouplink-sdk.podspec +6 -4
- package/ios/GrouplinkSdk-Bridging-Header.h +2 -2
- package/ios/GrouplinkSdk.mm +180 -0
- package/ios/GrouplinkSdk.swift +17 -30
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/xcuserdata/gabrieltorelo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/NativeGrouplinkSdk.js +9 -0
- package/lib/commonjs/NativeGrouplinkSdk.js.map +1 -0
- package/lib/commonjs/index.js +118 -91
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/NativeGrouplinkSdk.js +3 -0
- package/lib/module/NativeGrouplinkSdk.js.map +1 -0
- package/lib/module/index.js +118 -94
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/NativeGrouplinkSdk.d.ts +21 -0
- package/lib/typescript/NativeGrouplinkSdk.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +15 -13
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +10 -2
- package/src/NativeGrouplinkSdk.ts +25 -0
- package/src/index.tsx +185 -107
- package/ios/Frameworks/GroupLink-original.xcframework/Info.plist +0 -59
- package/ios/Frameworks/GroupLink-original.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/_CodeSignature/CodeRequirements +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/_CodeSignature/CodeResources +0 -607
- package/ios/Frameworks/GroupLink-original.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/GroupLink +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink-Swift.h +0 -388
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink.h +0 -18
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Info.plist +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.abi.json +0 -9288
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/Modules/module.modulemap +0 -11
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/PrivacyInfo.xcprivacy +0 -74
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/_CodeSignature/CodeResources +0 -212
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64/GroupLink.framework/critical.aiff +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/GroupLink +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink-Swift.h +0 -772
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink.h +0 -18
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Info.plist +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -9288
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -9288
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/module.modulemap +0 -11
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/PrivacyInfo.xcprivacy +0 -74
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/_CodeSignature/CodeResources +0 -267
- package/ios/Frameworks/GroupLink-original.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/critical.aiff +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/GroupLink +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Headers/GroupLink-Swift.h +0 -744
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Headers/GroupLink.h +0 -18
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/arm64-apple-macos.abi.json +0 -8376
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/arm64-apple-macos.private.swiftinterface +0 -175
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/arm64-apple-macos.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/arm64-apple-macos.swiftinterface +0 -175
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/x86_64-apple-macos.abi.json +0 -8376
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/x86_64-apple-macos.private.swiftinterface +0 -175
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/x86_64-apple-macos.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/GroupLink.swiftmodule/x86_64-apple-macos.swiftinterface +0 -175
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Modules/module.modulemap +0 -11
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Resources/Info.plist +0 -46
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Resources/PrivacyInfo.xcprivacy +0 -74
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/Resources/critical.aiff +0 -0
- package/ios/Frameworks/GroupLink-original.xcframework/macos-arm64_x86_64/GroupLink.framework/Versions/A/_CodeSignature/CodeResources +0 -241
- package/ios/Frameworks/GroupLink.xcframework/Info.plist +0 -44
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/GroupLink +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink-Swift.h +0 -388
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink.h +0 -18
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Info.plist +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.abi.json +0 -9288
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/module.modulemap +0 -11
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/PrivacyInfo.xcprivacy +0 -74
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/_CodeSignature/CodeResources +0 -212
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/critical.aiff +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/GroupLink +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink-Swift.h +0 -772
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink.h +0 -18
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Info.plist +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.abi.json +0 -9288
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.abi.json +0 -9288
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -202
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/module.modulemap +0 -11
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/PrivacyInfo.xcprivacy +0 -74
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/_CodeSignature/CodeResources +0 -267
- package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/critical.aiff +0 -0
- package/ios/GrouplinkSdk.m +0 -19
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/xcuserdata/alessandrodearaujo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- /package/ios/GrouplinkSdk.xcodeproj/xcuserdata/{alessandrodearaujo.xcuserdatad → gabrieltorelo.xcuserdatad}/xcschemes/xcschememanagement.plist +0 -0
package/lib/module/index.js
CHANGED
|
@@ -1,149 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
ios: "- You have run 'pod install'\n",
|
|
4
|
-
default: ''
|
|
5
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
6
|
-
const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK ? NativeModules.RNGroupLinkSDK : new Proxy({}, {
|
|
7
|
-
get() {
|
|
8
|
-
throw new Error(LINKING_ERROR);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
1
|
+
import { PermissionsAndroid, Platform } from 'react-native';
|
|
2
|
+
import NativeGroupLinkSDK from './NativeGrouplinkSdk';
|
|
11
3
|
export async function getUserId() {
|
|
12
|
-
if (
|
|
13
|
-
const userID = await
|
|
14
|
-
if (userID
|
|
4
|
+
if (_isAndroid()) {
|
|
5
|
+
const userID = await NativeGroupLinkSDK.getUserIdAndroid();
|
|
6
|
+
if (userID !== 'User not registered yet.') {
|
|
15
7
|
return Promise.resolve(userID);
|
|
16
8
|
} else {
|
|
17
|
-
return Promise.reject(
|
|
9
|
+
return Promise.reject('UserID not registered yet');
|
|
18
10
|
}
|
|
11
|
+
} else if (_isiOS()) {
|
|
12
|
+
return NativeGroupLinkSDK.getUserID();
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
const userID = await RNGroupLinkSDK.getUserID();
|
|
22
|
-
if (userID != null) {
|
|
23
|
-
return Promise.resolve(userID);
|
|
24
|
-
} else {
|
|
25
|
-
return Promise.reject("UserID not registered yet");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return Promise.reject("Internal Error");
|
|
14
|
+
return Promise.reject('Internal Error');
|
|
29
15
|
}
|
|
30
16
|
export function setFirebaseToken(token) {
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
if (token == null || token === '') {
|
|
18
|
+
_reportError('setFirebaseToken(token: string)', 'Requires a valid Firebase (FCM) token string.');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (_isAndroid()) {
|
|
22
|
+
NativeGroupLinkSDK.setFirebaseToken(token);
|
|
34
23
|
}
|
|
35
24
|
}
|
|
36
25
|
export function startBluetoothIOS() {
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
return RNGroupLinkSDK.startBluetoothIOS();
|
|
26
|
+
if (_isiOS()) {
|
|
27
|
+
NativeGroupLinkSDK.startBluetoothIOS();
|
|
40
28
|
}
|
|
41
|
-
return;
|
|
42
29
|
}
|
|
43
30
|
export function setDevicePushTokenIOS(token) {
|
|
44
|
-
|
|
31
|
+
if (token == null || token === '') {
|
|
32
|
+
_reportError('setDevicePushTokenIOS(token: string)', 'Requires a valid device push token string.');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (_isiOS()) {
|
|
36
|
+
NativeGroupLinkSDK.setDevicePushToken(token);
|
|
37
|
+
}
|
|
45
38
|
}
|
|
46
39
|
export function startLocationIOS() {
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
return RNGroupLinkSDK.startLocationIOS();
|
|
40
|
+
if (_isiOS()) {
|
|
41
|
+
NativeGroupLinkSDK.startLocationIOS();
|
|
50
42
|
}
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
function isAndroid() {
|
|
54
|
-
return Platform.OS == 'android';
|
|
55
|
-
}
|
|
56
|
-
function isiOS() {
|
|
57
|
-
return Platform.OS == 'ios';
|
|
58
|
-
}
|
|
59
|
-
function startAndroid(withToken, debbugable) {
|
|
60
|
-
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
61
|
-
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
62
|
-
}
|
|
63
|
-
function startIOS(withToken) {
|
|
64
|
-
console.log('Group Link SDK (IOS) - Start with token: ', withToken);
|
|
65
|
-
return RNGroupLinkSDK.startIOS(withToken);
|
|
66
43
|
}
|
|
67
44
|
export function startGrouplink(withToken, debbugable) {
|
|
68
|
-
if (
|
|
69
|
-
|
|
45
|
+
if (withToken == null || withToken === '') {
|
|
46
|
+
_reportError('startGrouplink(withToken: string, debbugable?: boolean | null)', 'Requires a valid GroupLink token string.');
|
|
47
|
+
return;
|
|
70
48
|
}
|
|
71
|
-
|
|
72
|
-
|
|
49
|
+
const debug = debbugable ?? false;
|
|
50
|
+
if (_isiOS()) {
|
|
51
|
+
NativeGroupLinkSDK.startIOS(withToken);
|
|
52
|
+
} else if (_isAndroid()) {
|
|
53
|
+
NativeGroupLinkSDK.startAndroid(withToken, debug);
|
|
73
54
|
}
|
|
74
55
|
}
|
|
75
56
|
export function startGrouplinkAndroid(withToken, debbugable) {
|
|
76
|
-
if (
|
|
77
|
-
|
|
57
|
+
if (withToken == null || withToken === '') {
|
|
58
|
+
_reportError('startGrouplinkAndroid(withToken: string, debbugable?: boolean | null)', 'Requires a valid GroupLink token string.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const debug = debbugable ?? false;
|
|
62
|
+
if (_isAndroid()) {
|
|
63
|
+
NativeGroupLinkSDK.startAndroid(withToken, debug);
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
66
|
export function startGrouplinkIOS(withToken) {
|
|
81
|
-
if (
|
|
82
|
-
|
|
67
|
+
if (withToken == null || withToken === '') {
|
|
68
|
+
_reportError('startGrouplinkIOS(withToken: string)', 'Requires a valid GroupLink token string.');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (_isiOS()) {
|
|
72
|
+
NativeGroupLinkSDK.startIOS(withToken);
|
|
83
73
|
}
|
|
84
74
|
}
|
|
85
75
|
export function checkBluetoothIOS() {
|
|
86
|
-
if (
|
|
76
|
+
if (_isiOS()) {
|
|
77
|
+
NativeGroupLinkSDK.checkBluetoothIOS();
|
|
78
|
+
}
|
|
87
79
|
}
|
|
88
80
|
export async function startBluetoothAndroid() {
|
|
89
|
-
if (!(Platform.OS ===
|
|
81
|
+
if (!(Platform.OS === 'android' && Platform.Version >= 31)) return;
|
|
90
82
|
const bluetoothPermission = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE, PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT]);
|
|
91
|
-
if (bluetoothPermission[
|
|
83
|
+
if (bluetoothPermission['android.permission.BLUETOOTH_SCAN'] === PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission['android.permission.BLUETOOTH_ADVERTISE'] === PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission['android.permission.BLUETOOTH_CONNECT'] === PermissionsAndroid.RESULTS.GRANTED) {
|
|
84
|
+
NativeGroupLinkSDK.startAndroid('', false);
|
|
85
|
+
}
|
|
92
86
|
}
|
|
93
|
-
;
|
|
94
87
|
export async function startLocationAndroid() {
|
|
95
|
-
if (!(Platform.OS
|
|
88
|
+
if (!(Platform.OS === 'android' && Platform.Version >= 23)) return;
|
|
96
89
|
const locationPermission = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]);
|
|
97
|
-
if (locationPermission[
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
90
|
+
if (locationPermission['android.permission.ACCESS_COARSE_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED && locationPermission['android.permission.ACCESS_FINE_LOCATION'] === PermissionsAndroid.RESULTS.GRANTED) {
|
|
91
|
+
// Permissions granted
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export async function startLocation() {
|
|
95
|
+
if (_isiOS()) {
|
|
96
|
+
NativeGroupLinkSDK.startLocationIOS();
|
|
97
|
+
} else if (_isAndroid()) {
|
|
98
|
+
await startLocationAndroid();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export async function startBluetooth() {
|
|
102
|
+
if (_isiOS()) {
|
|
103
|
+
NativeGroupLinkSDK.startBluetoothIOS();
|
|
104
|
+
} else if (_isAndroid()) {
|
|
105
|
+
await startBluetoothAndroid();
|
|
101
106
|
}
|
|
102
107
|
}
|
|
103
108
|
export function requestFullIntentPermissionAndroid() {
|
|
104
|
-
if (
|
|
105
|
-
|
|
109
|
+
if (_isAndroid()) {
|
|
110
|
+
NativeGroupLinkSDK.requestFullIntentPermissionAndroid();
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
113
|
export function setNotificationNameAndroid(name) {
|
|
109
|
-
if (
|
|
110
|
-
|
|
114
|
+
if (name == null || name === '') {
|
|
115
|
+
_reportError('setNotificationNameAndroid(name: string)', 'Requires a valid notification name string.');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (_isAndroid()) {
|
|
119
|
+
NativeGroupLinkSDK.setNotificationNameAndroid(name);
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
|
-
export function getNotificationNameAndroid() {
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
122
|
+
export async function getNotificationNameAndroid() {
|
|
123
|
+
if (_isAndroid()) {
|
|
124
|
+
return NativeGroupLinkSDK.getNotificationNameAndroid();
|
|
116
125
|
}
|
|
126
|
+
return null;
|
|
117
127
|
}
|
|
118
128
|
export function setNotificationNameIOS(name) {
|
|
119
|
-
if (
|
|
120
|
-
|
|
129
|
+
if (name == null || name === '') {
|
|
130
|
+
_reportError('setNotificationNameIOS(name: string)', 'Requires a valid notification name string.');
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (_isiOS()) {
|
|
134
|
+
NativeGroupLinkSDK.setNotificationNameIOS(name);
|
|
121
135
|
}
|
|
122
136
|
}
|
|
123
|
-
export function getNotificationNameIOS() {
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
137
|
+
export async function getNotificationNameIOS() {
|
|
138
|
+
if (_isiOS()) {
|
|
139
|
+
return NativeGroupLinkSDK.getNotificationNameIOS();
|
|
126
140
|
}
|
|
141
|
+
return null;
|
|
127
142
|
}
|
|
128
143
|
export function setNotificationName(name) {
|
|
129
|
-
if (
|
|
130
|
-
|
|
144
|
+
if (name == null || name === '') {
|
|
145
|
+
_reportError('setNotificationName(name: string)', 'Requires a valid notification name string.');
|
|
146
|
+
return;
|
|
131
147
|
}
|
|
132
|
-
if (
|
|
133
|
-
|
|
148
|
+
if (_isAndroid()) {
|
|
149
|
+
NativeGroupLinkSDK.setNotificationNameAndroid(name);
|
|
150
|
+
} else if (_isiOS()) {
|
|
151
|
+
NativeGroupLinkSDK.setNotificationNameIOS(name);
|
|
134
152
|
}
|
|
135
153
|
}
|
|
136
154
|
export function requestScheduleExactAlarmPermissionAndroid() {
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
155
|
+
if (_isAndroid()) {
|
|
156
|
+
NativeGroupLinkSDK.requestScheduleExactAlarm();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function _reportError(signature, message) {
|
|
160
|
+
const err = new Error(`[GroupLinkSDK] ${signature} → ${message}`);
|
|
161
|
+
if (err.stack) {
|
|
162
|
+
const lines = err.stack.split('\n');
|
|
163
|
+
err.stack = [lines[0], ...lines.slice(3)].join('\n');
|
|
164
|
+
}
|
|
165
|
+
console.error(err);
|
|
166
|
+
}
|
|
167
|
+
function _isAndroid() {
|
|
168
|
+
return Platform.OS === 'android';
|
|
169
|
+
}
|
|
170
|
+
function _isiOS() {
|
|
171
|
+
return Platform.OS === 'ios';
|
|
172
|
+
}
|
|
149
173
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["PermissionsAndroid","Platform","NativeGroupLinkSDK","getUserId","_isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","_isiOS","getUserID","setFirebaseToken","token","_reportError","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","startGrouplink","withToken","debbugable","debug","startIOS","startAndroid","startGrouplinkAndroid","startGrouplinkIOS","checkBluetoothIOS","startBluetoothAndroid","OS","Version","bluetoothPermission","requestMultiple","PERMISSIONS","BLUETOOTH_SCAN","BLUETOOTH_ADVERTISE","BLUETOOTH_CONNECT","RESULTS","GRANTED","startLocationAndroid","locationPermission","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","startLocation","startBluetooth","requestFullIntentPermissionAndroid","setNotificationNameAndroid","name","getNotificationNameAndroid","setNotificationNameIOS","getNotificationNameIOS","setNotificationName","requestScheduleExactAlarmPermissionAndroid","requestScheduleExactAlarm","signature","message","err","Error","stack","lines","split","slice","join","console","error"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC3D,OAAOC,kBAAkB,MAAM,sBAAsB;AAErD,OAAO,eAAeC,SAASA,CAAA,EAA2B;EACxD,IAAIC,UAAU,CAAC,CAAC,EAAE;IAChB,MAAMC,MAAc,GAAG,MAAMH,kBAAkB,CA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,IAAI,IAAI,IAAI,IAAIA,IAAI,KAAK,EAAE,EAAE;IAC/BjC,YAAY,CACV,mCAAmC,EACnC,4CACF,CAAC;IAED;EACF;EAEA,IAAIV,UAAU,CAAC,CAAC,EAAE;IAChBF,kBAAkB,CAAC4C,0BAA0B,CAACC,IAAI,CAAC;EACrD,CAAC,MAAM,IAAIrC,MAAM,CAAC,CAAC,EAAE;IACnBR,kBAAkB,CAAC+C,sBAAsB,CAACF,IAAI,CAAC;EACjD;AACF;AAEA,OAAO,SAASK,0CAA0CA,CAAA,EAAG;EAC3D,IAAIhD,UAAU,CAAC,CAAC,EAAE;IAChBF,kBAAkB,CAACmD,yBAAyB,CAAC,CAAC;EAChD;AACF;AAEA,SAASvC,YAAYA,CAACwC,SAAiB,EAAEC,OAAe,EAAE;EACxD,MAAMC,GAAG,GAAG,IAAIC,KAAK,CAAC,kBAAkBH,SAAS,MAAMC,OAAO,EAAE,CAAC;EAEjE,IAAIC,GAAG,CAACE,KAAK,EAAE;IACb,MAAMC,KAAK,GAAGH,GAAG,CAACE,KAAK,CAACE,KAAK,CAAC,IAAI,CAAC;IACnCJ,GAAG,CAACE,KAAK,GAAG,CAACC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAGA,KAAK,CAACE,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC;EACtD;EAEAC,OAAO,CAACC,KAAK,CAACR,GAAG,CAAC;AACpB;AAEA,SAASpD,UAAUA,CAAA,EAAG;EACpB,OAAOH,QAAQ,CAAC4B,EAAE,KAAK,SAAS;AAClC;AAEA,SAASnB,MAAMA,CAAA,EAAG;EAChB,OAAOT,QAAQ,CAAC4B,EAAE,KAAK,KAAK;AAC9B","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
getUserIdAndroid(): Promise<string>;
|
|
4
|
+
startAndroid(token: string, debbugable: boolean): void;
|
|
5
|
+
setFirebaseToken(token: string): void;
|
|
6
|
+
requestFullIntentPermissionAndroid(): void;
|
|
7
|
+
setNotificationNameAndroid(notificationName: string): void;
|
|
8
|
+
getNotificationNameAndroid(): Promise<string>;
|
|
9
|
+
requestScheduleExactAlarm(): void;
|
|
10
|
+
getUserID(): Promise<string>;
|
|
11
|
+
setDevicePushToken(withPushToken: string): void;
|
|
12
|
+
startIOS(withToken: string): void;
|
|
13
|
+
startBluetoothIOS(): void;
|
|
14
|
+
checkBluetoothIOS(): void;
|
|
15
|
+
startLocationIOS(): void;
|
|
16
|
+
setNotificationNameIOS(withNotificationName: string): void;
|
|
17
|
+
getNotificationNameIOS(): Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: Spec;
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=NativeGrouplinkSdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeGrouplinkSdk.d.ts","sourceRoot":"","sources":["../../src/NativeGrouplinkSdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IAEvC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IACvD,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,kCAAkC,IAAI,IAAI,CAAC;IAC3C,0BAA0B,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3D,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,yBAAyB,IAAI,IAAI,CAAC;IAGlC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iBAAiB,IAAI,IAAI,CAAC;IAC1B,iBAAiB,IAAI,IAAI,CAAC;IAC1B,gBAAgB,IAAI,IAAI,CAAC;IACzB,sBAAsB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3D,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C;;AAED,wBAAwE"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export declare function getUserId(): Promise<string | null>;
|
|
2
2
|
export declare function setFirebaseToken(token: string): void;
|
|
3
|
-
export declare function startBluetoothIOS():
|
|
4
|
-
export declare function setDevicePushTokenIOS(token: string):
|
|
5
|
-
export declare function startLocationIOS():
|
|
6
|
-
export declare function startGrouplink(withToken: string, debbugable
|
|
7
|
-
export declare function startGrouplinkAndroid(withToken: string, debbugable
|
|
3
|
+
export declare function startBluetoothIOS(): void;
|
|
4
|
+
export declare function setDevicePushTokenIOS(token: string): void;
|
|
5
|
+
export declare function startLocationIOS(): void;
|
|
6
|
+
export declare function startGrouplink(withToken: string, debbugable?: boolean | null): void;
|
|
7
|
+
export declare function startGrouplinkAndroid(withToken: string, debbugable?: boolean | null): void;
|
|
8
8
|
export declare function startGrouplinkIOS(withToken: string): void;
|
|
9
|
-
export declare function checkBluetoothIOS():
|
|
9
|
+
export declare function checkBluetoothIOS(): void;
|
|
10
10
|
export declare function startBluetoothAndroid(): Promise<void>;
|
|
11
11
|
export declare function startLocationAndroid(): Promise<void>;
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function
|
|
18
|
-
export declare function
|
|
12
|
+
export declare function startLocation(): Promise<void>;
|
|
13
|
+
export declare function startBluetooth(): Promise<void>;
|
|
14
|
+
export declare function requestFullIntentPermissionAndroid(): void;
|
|
15
|
+
export declare function setNotificationNameAndroid(name: string): void;
|
|
16
|
+
export declare function getNotificationNameAndroid(): Promise<string | null>;
|
|
17
|
+
export declare function setNotificationNameIOS(name: string): void;
|
|
18
|
+
export declare function getNotificationNameIOS(): Promise<string | null>;
|
|
19
|
+
export declare function setNotificationName(name: string): void;
|
|
20
|
+
export declare function requestScheduleExactAlarmPermissionAndroid(): void;
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAGA,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAaxD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,QAa7C;AAED,wBAAgB,iBAAiB,SAIhC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,QAalD;AAED,wBAAgB,gBAAgB,SAI/B;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,QAiB5E;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,QAenF;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,QAalD;AAED,wBAAgB,iBAAiB,SAIhC;AAED,wBAAsB,qBAAqB,kBAkB1C;AAED,wBAAsB,oBAAoB,kBAczC;AAED,wBAAsB,aAAa,kBAMlC;AAED,wBAAsB,cAAc,kBAMnC;AAED,wBAAgB,kCAAkC,SAIjD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,QAatD;AAED,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMzE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,QAalD;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMrE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,QAe/C;AAED,wBAAgB,0CAA0C,SAIzD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grouplinknetwork/rn-grouplink-sdk",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.5.1",
|
|
4
|
+
"description": "Plugin for implementing the company's native sdk group link",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
@@ -114,6 +114,14 @@
|
|
|
114
114
|
"trailingComma": "es5",
|
|
115
115
|
"useTabs": false
|
|
116
116
|
},
|
|
117
|
+
"codegenConfig": {
|
|
118
|
+
"name": "GrouplinkSdkSpec",
|
|
119
|
+
"type": "modules",
|
|
120
|
+
"jsSrcsDir": "src",
|
|
121
|
+
"android": {
|
|
122
|
+
"javaPackageName": "com.grouplinksdk"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
117
125
|
"react-native-builder-bob": {
|
|
118
126
|
"source": "src",
|
|
119
127
|
"output": "lib",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
// Android-only methods
|
|
6
|
+
getUserIdAndroid(): Promise<string>;
|
|
7
|
+
startAndroid(token: string, debbugable: boolean): void;
|
|
8
|
+
setFirebaseToken(token: string): void;
|
|
9
|
+
requestFullIntentPermissionAndroid(): void;
|
|
10
|
+
setNotificationNameAndroid(notificationName: string): void;
|
|
11
|
+
getNotificationNameAndroid(): Promise<string>;
|
|
12
|
+
requestScheduleExactAlarm(): void;
|
|
13
|
+
|
|
14
|
+
// iOS-only methods
|
|
15
|
+
getUserID(): Promise<string>;
|
|
16
|
+
setDevicePushToken(withPushToken: string): void;
|
|
17
|
+
startIOS(withToken: string): void;
|
|
18
|
+
startBluetoothIOS(): void;
|
|
19
|
+
checkBluetoothIOS(): void;
|
|
20
|
+
startLocationIOS(): void;
|
|
21
|
+
setNotificationNameIOS(withNotificationName: string): void;
|
|
22
|
+
getNotificationNameIOS(): Promise<string>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('RNGroupLinkSDK');
|