@grouplinknetwork/rn-grouplink-sdk 2.3.4 → 2.3.7
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/LICENSE +20 -20
- package/README.md +10 -7
- package/android/build.gradle +140 -140
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradle.properties +5 -5
- package/android/gradlew +234 -234
- package/android/src/main/AndroidManifest.xml +24 -24
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +133 -133
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkPackage.java +28 -28
- package/grouplink-sdk.podspec +36 -36
- package/ios/GrouplinkSdk-Bridging-Header.h +1 -1
- package/ios/GrouplinkSdk.m +18 -17
- package/ios/GrouplinkSdk.swift +39 -34
- package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -283
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/xcuserdata/alessandrodearaujo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/GrouplinkSdk.xcodeproj/xcuserdata/alessandrodearaujo.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/index.js +13 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +131 -131
- package/src/index.tsx +99 -92
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -19
- package/android/.idea/jarRepositories.xml +0 -30
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
package/lib/module/index.js
CHANGED
|
@@ -8,11 +8,6 @@ const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK ? NativeModules.RNGroupLinkS
|
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
export function startGrouplinkAndroid(token, debbugable) {
|
|
12
|
-
if (isAndroid()) {
|
|
13
|
-
startAndroid(token, debbugable);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
11
|
export async function getUserId() {
|
|
17
12
|
if (isAndroid()) {
|
|
18
13
|
const userID = await RNGroupLinkSDK.getUserIdAndroid();
|
|
@@ -65,6 +60,18 @@ function startAndroid(withToken, debbugable) {
|
|
|
65
60
|
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
66
61
|
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
67
62
|
}
|
|
63
|
+
function startIOS(withToken) {
|
|
64
|
+
console.log('Group Link SDK (IOS) - Start with token: ', withToken);
|
|
65
|
+
return RNGroupLinkSDK.startIOS(withToken);
|
|
66
|
+
}
|
|
67
|
+
export function start(withToken, debbugable) {
|
|
68
|
+
if (isiOS()) {
|
|
69
|
+
startIOS(withToken);
|
|
70
|
+
}
|
|
71
|
+
if (isAndroid()) {
|
|
72
|
+
startAndroid(withToken, debbugable);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
68
75
|
|
|
69
76
|
// function getUserIDiOS(success: (userId: string) => void) {
|
|
70
77
|
// RNGroupLinkSDK.getUserID(success);
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","getUserId","isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","isiOS","getUserID","setFirebaseToken","token","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","startAndroid","withToken","debbugable","startIOS","start"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function startGrouplinkAndroid(token: string, debbugable: boolean): void;
|
|
2
1
|
export declare function getUserId(): Promise<string | null>;
|
|
3
2
|
export declare function setFirebaseToken(token: string): void;
|
|
4
3
|
export declare function startBluetoothIOS(): any;
|
|
5
4
|
export declare function setDevicePushTokenIOS(token: string): any;
|
|
6
5
|
export declare function startLocationIOS(): any;
|
|
6
|
+
export declare function start(withToken: string, debbugable: boolean): void;
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,QAK7C;AAED,wBAAgB,iBAAiB,QAMhC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,OAElD;AAED,wBAAgB,gBAAgB,QAM/B;AAmBD,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAO3D"}
|
package/package.json
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@grouplinknetwork/rn-grouplink-sdk",
|
|
3
|
-
"version": "2.3.
|
|
4
|
-
"description": "test",
|
|
5
|
-
"main": "lib/commonjs/index",
|
|
6
|
-
"module": "lib/module/index",
|
|
7
|
-
"types": "lib/typescript/index.d.ts",
|
|
8
|
-
"react-native": "src/index",
|
|
9
|
-
"source": "src/index",
|
|
10
|
-
"files": [
|
|
11
|
-
"src",
|
|
12
|
-
"lib",
|
|
13
|
-
"android",
|
|
14
|
-
"ios",
|
|
15
|
-
"cpp",
|
|
16
|
-
"grouplink-sdk.podspec",
|
|
17
|
-
"!lib/typescript/example",
|
|
18
|
-
"!android/build",
|
|
19
|
-
"!ios/build",
|
|
20
|
-
"!**/__tests__",
|
|
21
|
-
"!**/__fixtures__",
|
|
22
|
-
"!**/__mocks__"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"test": "jest",
|
|
26
|
-
"typescript": "tsc --noEmit",
|
|
27
|
-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
28
|
-
"prepare": "bob build",
|
|
29
|
-
"release": "release-it",
|
|
30
|
-
"example": "yarn --cwd example",
|
|
31
|
-
"bootstrap": "yarn example && yarn && yarn example pods"
|
|
32
|
-
},
|
|
33
|
-
"keywords": [
|
|
34
|
-
"react-native",
|
|
35
|
-
"ios",
|
|
36
|
-
"android"
|
|
37
|
-
],
|
|
38
|
-
"repository": "https://github.com/amazingvitor/grouplink-sdk",
|
|
39
|
-
"author": "Vitor Hugo <v.macedo@grouplinknetwork.com> (https://github.com/amazingvitor)",
|
|
40
|
-
"license": "MIT",
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://github.com/amazingvitor/grouplink-sdk/issues"
|
|
43
|
-
},
|
|
44
|
-
"homepage": "https://github.com/amazingvitor/grouplink-sdk#readme",
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"registry": "https://registry.npmjs.org/",
|
|
47
|
-
"access": "public"
|
|
48
|
-
},
|
|
49
|
-
"devDependencies": {
|
|
50
|
-
"@arkweid/lefthook": "^0.7.7",
|
|
51
|
-
"@babel/eslint-parser": "^7.18.2",
|
|
52
|
-
"@commitlint/config-conventional": "^18.4.2",
|
|
53
|
-
"@react-native-community/eslint-config": "^3.0.2",
|
|
54
|
-
"@release-it/conventional-changelog": "^8.0.1",
|
|
55
|
-
"@types/jest": "^29.5.8",
|
|
56
|
-
"@types/react": "~18.2.37",
|
|
57
|
-
"@types/react-native": "0.72.6",
|
|
58
|
-
"babel-eslint": "^10.1.0",
|
|
59
|
-
"commitlint": "^18.4.2",
|
|
60
|
-
"eslint": "^8.4.1",
|
|
61
|
-
"eslint-config-prettier": "^9.0.0",
|
|
62
|
-
"eslint-plugin-prettier": "^5.0.1",
|
|
63
|
-
"jest": "^29.7.0",
|
|
64
|
-
"pod-install": "^0.1.0",
|
|
65
|
-
"prettier": "^3.1.0",
|
|
66
|
-
"react": "18.2.0",
|
|
67
|
-
"react-native": "0.72.7",
|
|
68
|
-
"react-native-builder-bob": "^0.23.1",
|
|
69
|
-
"release-it": "^17.0.0",
|
|
70
|
-
"typescript": "^5.2.2"
|
|
71
|
-
},
|
|
72
|
-
"resolutions": {
|
|
73
|
-
"@types/react": "17.0.21"
|
|
74
|
-
},
|
|
75
|
-
"peerDependencies": {
|
|
76
|
-
"react": "*",
|
|
77
|
-
"react-native": "*"
|
|
78
|
-
},
|
|
79
|
-
"jest": {
|
|
80
|
-
"preset": "react-native",
|
|
81
|
-
"modulePathIgnorePatterns": [
|
|
82
|
-
"<rootDir>/example/node_modules",
|
|
83
|
-
"<rootDir>/lib/"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"eslintConfig": {
|
|
87
|
-
"root": true,
|
|
88
|
-
"parser": "@babel/eslint-parser",
|
|
89
|
-
"extends": [
|
|
90
|
-
"@react-native-community",
|
|
91
|
-
"prettier"
|
|
92
|
-
],
|
|
93
|
-
"rules": {
|
|
94
|
-
"prettier/prettier": [
|
|
95
|
-
"error",
|
|
96
|
-
{
|
|
97
|
-
"quoteProps": "consistent",
|
|
98
|
-
"singleQuote": true,
|
|
99
|
-
"tabWidth": 2,
|
|
100
|
-
"trailingComma": "es5",
|
|
101
|
-
"useTabs": false
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
"eslintIgnore": [
|
|
107
|
-
"node_modules/",
|
|
108
|
-
"lib/"
|
|
109
|
-
],
|
|
110
|
-
"prettier": {
|
|
111
|
-
"quoteProps": "consistent",
|
|
112
|
-
"singleQuote": true,
|
|
113
|
-
"tabWidth": 2,
|
|
114
|
-
"trailingComma": "es5",
|
|
115
|
-
"useTabs": false
|
|
116
|
-
},
|
|
117
|
-
"react-native-builder-bob": {
|
|
118
|
-
"source": "src",
|
|
119
|
-
"output": "lib",
|
|
120
|
-
"targets": [
|
|
121
|
-
"commonjs",
|
|
122
|
-
"module",
|
|
123
|
-
[
|
|
124
|
-
"typescript",
|
|
125
|
-
{
|
|
126
|
-
"project": "tsconfig.build.json"
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@grouplinknetwork/rn-grouplink-sdk",
|
|
3
|
+
"version": "2.3.7",
|
|
4
|
+
"description": "test",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"android",
|
|
14
|
+
"ios",
|
|
15
|
+
"cpp",
|
|
16
|
+
"grouplink-sdk.podspec",
|
|
17
|
+
"!lib/typescript/example",
|
|
18
|
+
"!android/build",
|
|
19
|
+
"!ios/build",
|
|
20
|
+
"!**/__tests__",
|
|
21
|
+
"!**/__fixtures__",
|
|
22
|
+
"!**/__mocks__"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"typescript": "tsc --noEmit",
|
|
27
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
28
|
+
"prepare": "bob build",
|
|
29
|
+
"release": "release-it",
|
|
30
|
+
"example": "yarn --cwd example",
|
|
31
|
+
"bootstrap": "yarn example && yarn && yarn example pods"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"react-native",
|
|
35
|
+
"ios",
|
|
36
|
+
"android"
|
|
37
|
+
],
|
|
38
|
+
"repository": "https://github.com/amazingvitor/grouplink-sdk",
|
|
39
|
+
"author": "Vitor Hugo <v.macedo@grouplinknetwork.com> (https://github.com/amazingvitor)",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/amazingvitor/grouplink-sdk/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/amazingvitor/grouplink-sdk#readme",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"registry": "https://registry.npmjs.org/",
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@arkweid/lefthook": "^0.7.7",
|
|
51
|
+
"@babel/eslint-parser": "^7.18.2",
|
|
52
|
+
"@commitlint/config-conventional": "^18.4.2",
|
|
53
|
+
"@react-native-community/eslint-config": "^3.0.2",
|
|
54
|
+
"@release-it/conventional-changelog": "^8.0.1",
|
|
55
|
+
"@types/jest": "^29.5.8",
|
|
56
|
+
"@types/react": "~18.2.37",
|
|
57
|
+
"@types/react-native": "0.72.6",
|
|
58
|
+
"babel-eslint": "^10.1.0",
|
|
59
|
+
"commitlint": "^18.4.2",
|
|
60
|
+
"eslint": "^8.4.1",
|
|
61
|
+
"eslint-config-prettier": "^9.0.0",
|
|
62
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
63
|
+
"jest": "^29.7.0",
|
|
64
|
+
"pod-install": "^0.1.0",
|
|
65
|
+
"prettier": "^3.1.0",
|
|
66
|
+
"react": "18.2.0",
|
|
67
|
+
"react-native": "0.72.7",
|
|
68
|
+
"react-native-builder-bob": "^0.23.1",
|
|
69
|
+
"release-it": "^17.0.0",
|
|
70
|
+
"typescript": "^5.2.2"
|
|
71
|
+
},
|
|
72
|
+
"resolutions": {
|
|
73
|
+
"@types/react": "17.0.21"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"react": "*",
|
|
77
|
+
"react-native": "*"
|
|
78
|
+
},
|
|
79
|
+
"jest": {
|
|
80
|
+
"preset": "react-native",
|
|
81
|
+
"modulePathIgnorePatterns": [
|
|
82
|
+
"<rootDir>/example/node_modules",
|
|
83
|
+
"<rootDir>/lib/"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"eslintConfig": {
|
|
87
|
+
"root": true,
|
|
88
|
+
"parser": "@babel/eslint-parser",
|
|
89
|
+
"extends": [
|
|
90
|
+
"@react-native-community",
|
|
91
|
+
"prettier"
|
|
92
|
+
],
|
|
93
|
+
"rules": {
|
|
94
|
+
"prettier/prettier": [
|
|
95
|
+
"error",
|
|
96
|
+
{
|
|
97
|
+
"quoteProps": "consistent",
|
|
98
|
+
"singleQuote": true,
|
|
99
|
+
"tabWidth": 2,
|
|
100
|
+
"trailingComma": "es5",
|
|
101
|
+
"useTabs": false
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"eslintIgnore": [
|
|
107
|
+
"node_modules/",
|
|
108
|
+
"lib/"
|
|
109
|
+
],
|
|
110
|
+
"prettier": {
|
|
111
|
+
"quoteProps": "consistent",
|
|
112
|
+
"singleQuote": true,
|
|
113
|
+
"tabWidth": 2,
|
|
114
|
+
"trailingComma": "es5",
|
|
115
|
+
"useTabs": false
|
|
116
|
+
},
|
|
117
|
+
"react-native-builder-bob": {
|
|
118
|
+
"source": "src",
|
|
119
|
+
"output": "lib",
|
|
120
|
+
"targets": [
|
|
121
|
+
"commonjs",
|
|
122
|
+
"module",
|
|
123
|
+
[
|
|
124
|
+
"typescript",
|
|
125
|
+
{
|
|
126
|
+
"project": "tsconfig.build.json"
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,92 +1,99 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
const LINKING_ERROR =
|
|
4
|
-
`The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
-
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
-
'- You rebuilt the app after installing the package\n' +
|
|
7
|
-
'- You are not using Expo managed workflow\n';
|
|
8
|
-
|
|
9
|
-
const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK
|
|
10
|
-
? NativeModules.RNGroupLinkSDK
|
|
11
|
-
: new Proxy(
|
|
12
|
-
{},
|
|
13
|
-
{
|
|
14
|
-
get() {
|
|
15
|
-
throw new Error(LINKING_ERROR);
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export function
|
|
21
|
-
if (isAndroid()) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return Promise.
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const LINKING_ERROR =
|
|
4
|
+
`The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
5
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
6
|
+
'- You rebuilt the app after installing the package\n' +
|
|
7
|
+
'- You are not using Expo managed workflow\n';
|
|
8
|
+
|
|
9
|
+
const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK
|
|
10
|
+
? NativeModules.RNGroupLinkSDK
|
|
11
|
+
: new Proxy(
|
|
12
|
+
{},
|
|
13
|
+
{
|
|
14
|
+
get() {
|
|
15
|
+
throw new Error(LINKING_ERROR);
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export async function getUserId(): Promise<string | null> {
|
|
21
|
+
if (isAndroid()) {
|
|
22
|
+
const userID: string = await RNGroupLinkSDK.getUserIdAndroid();
|
|
23
|
+
if(userID != "User not registered yet.") {
|
|
24
|
+
return Promise.resolve(userID);
|
|
25
|
+
} else {
|
|
26
|
+
return Promise.reject("UserID not registered yet")
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (isiOS()) {
|
|
30
|
+
const userID: string = await RNGroupLinkSDK.getUserID();
|
|
31
|
+
if(userID != null) {
|
|
32
|
+
return Promise.resolve(userID);
|
|
33
|
+
} else {
|
|
34
|
+
return Promise.reject("UserID not registered yet")
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return Promise.reject("Internal Error");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function setFirebaseToken(token: string) {
|
|
41
|
+
if (isAndroid()) {
|
|
42
|
+
console.log('Android: setting firebase token');
|
|
43
|
+
RNGroupLinkSDK.setFirebaseToken(token);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function startBluetoothIOS() {
|
|
48
|
+
if (isiOS()) {
|
|
49
|
+
console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
|
|
50
|
+
return RNGroupLinkSDK.startBluetoothIOS();
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setDevicePushTokenIOS(token: string) {
|
|
56
|
+
return RNGroupLinkSDK.setDevicePushToken(token);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function startLocationIOS() {
|
|
60
|
+
if (isiOS()) {
|
|
61
|
+
console.log('Group Link SDK (iOS) - Start Location Stack');
|
|
62
|
+
return RNGroupLinkSDK.startLocationIOS();
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isAndroid() {
|
|
68
|
+
return Platform.OS == 'android';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function isiOS() {
|
|
72
|
+
return Platform.OS == 'ios';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function startAndroid(withToken: string, debbugable: boolean) {
|
|
76
|
+
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
77
|
+
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
78
|
+
}
|
|
79
|
+
function startIOS(withToken: string) {
|
|
80
|
+
console.log('Group Link SDK (IOS) - Start with token: ', withToken);
|
|
81
|
+
return RNGroupLinkSDK.startIOS(withToken);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function start(withToken: string, debbugable: boolean){
|
|
85
|
+
if (isiOS()) {
|
|
86
|
+
startIOS(withToken);
|
|
87
|
+
}
|
|
88
|
+
if (isAndroid()) {
|
|
89
|
+
startAndroid(withToken, debbugable);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// function getUserIDiOS(success: (userId: string) => void) {
|
|
94
|
+
// RNGroupLinkSDK.getUserID(success);
|
|
95
|
+
// }
|
|
96
|
+
|
|
97
|
+
// function success(userId: string): void {
|
|
98
|
+
// throw new Error('Function not implemented.');
|
|
99
|
+
// }
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/android/.idea/gradle.xml
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
-
<component name="GradleSettings">
|
|
5
|
-
<option name="linkedExternalProjectsSettings">
|
|
6
|
-
<GradleProjectSettings>
|
|
7
|
-
<option name="testRunner" value="GRADLE" />
|
|
8
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
-
<option name="gradleJvm" value="jbr-17" />
|
|
11
|
-
<option name="modules">
|
|
12
|
-
<set>
|
|
13
|
-
<option value="$PROJECT_DIR$" />
|
|
14
|
-
</set>
|
|
15
|
-
</option>
|
|
16
|
-
</GradleProjectSettings>
|
|
17
|
-
</option>
|
|
18
|
-
</component>
|
|
19
|
-
</project>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
-
<remote-repository>
|
|
5
|
-
<option name="id" value="central" />
|
|
6
|
-
<option name="name" value="Maven Central repository" />
|
|
7
|
-
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
-
</remote-repository>
|
|
9
|
-
<remote-repository>
|
|
10
|
-
<option name="id" value="jboss.community" />
|
|
11
|
-
<option name="name" value="JBoss Community repository" />
|
|
12
|
-
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
-
</remote-repository>
|
|
14
|
-
<remote-repository>
|
|
15
|
-
<option name="id" value="MavenRepo" />
|
|
16
|
-
<option name="name" value="MavenRepo" />
|
|
17
|
-
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
18
|
-
</remote-repository>
|
|
19
|
-
<remote-repository>
|
|
20
|
-
<option name="id" value="React Native sources" />
|
|
21
|
-
<option name="name" value="React Native sources" />
|
|
22
|
-
<option name="url" value="file:/$PROJECT_DIR$/../node_modules/react-native/android/" />
|
|
23
|
-
</remote-repository>
|
|
24
|
-
<remote-repository>
|
|
25
|
-
<option name="id" value="Google" />
|
|
26
|
-
<option name="name" value="Google" />
|
|
27
|
-
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
28
|
-
</remote-repository>
|
|
29
|
-
</component>
|
|
30
|
-
</project>
|
package/android/.idea/misc.xml
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<project version="4">
|
|
2
|
-
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
3
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
|
4
|
-
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
5
|
-
</component>
|
|
6
|
-
<component name="ProjectType">
|
|
7
|
-
<option name="id" value="Android" />
|
|
8
|
-
</component>
|
|
9
|
-
</project>
|