@grouplinknetwork/rn-grouplink-sdk 2.3.3 → 2.3.4

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.
Files changed (42) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +7 -7
  3. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  7. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  8. package/android/.gradle/7.4/executionHistory/executionHistory.bin +0 -0
  9. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  10. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  11. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  12. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  14. package/android/.gradle/7.4/gc.properties +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  17. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  18. package/android/.gradle/config.properties +2 -0
  19. package/android/.gradle/file-system.probe +0 -0
  20. package/android/.gradle/vcs-1/gc.properties +0 -0
  21. package/android/.idea/compiler.xml +6 -0
  22. package/android/.idea/gradle.xml +19 -0
  23. package/android/.idea/jarRepositories.xml +30 -0
  24. package/android/.idea/misc.xml +9 -0
  25. package/android/.idea/vcs.xml +6 -0
  26. package/android/build.gradle +140 -140
  27. package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  28. package/android/gradle.properties +5 -5
  29. package/android/gradlew +234 -234
  30. package/android/local.properties +8 -0
  31. package/android/src/main/AndroidManifest.xml +24 -24
  32. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +133 -133
  33. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkPackage.java +28 -28
  34. package/grouplink-sdk.podspec +36 -36
  35. package/ios/GrouplinkSdk-Bridging-Header.h +1 -1
  36. package/ios/GrouplinkSdk.m +17 -17
  37. package/ios/GrouplinkSdk.swift +34 -34
  38. package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -283
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/module/index.js.map +1 -1
  41. package/package.json +131 -131
  42. package/src/index.tsx +92 -92
package/package.json CHANGED
@@ -1,131 +1,131 @@
1
- {
2
- "name": "@grouplinknetwork/rn-grouplink-sdk",
3
- "version": "2.3.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.4",
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,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 function startGrouplinkAndroid(token: string, debbugable: boolean) {
21
- if (isAndroid()) {
22
- startAndroid(token, debbugable);
23
- }
24
- }
25
-
26
- export async function getUserId(): Promise<string | null> {
27
- if (isAndroid()) {
28
- const userID: string = await RNGroupLinkSDK.getUserIdAndroid();
29
- if(userID != "User not registered yet.") {
30
- return Promise.resolve(userID);
31
- } else {
32
- return Promise.reject("UserID not registered yet")
33
- }
34
- }
35
- if (isiOS()) {
36
- const userID: string = await RNGroupLinkSDK.getUserID();
37
- if(userID != null) {
38
- return Promise.resolve(userID);
39
- } else {
40
- return Promise.reject("UserID not registered yet")
41
- }
42
- }
43
- return Promise.reject("Internal Error");
44
- }
45
-
46
- export function setFirebaseToken(token: string) {
47
- if (isAndroid()) {
48
- console.log('Android: setting firebase token');
49
- RNGroupLinkSDK.setFirebaseToken(token);
50
- }
51
- }
52
-
53
- export function startBluetoothIOS() {
54
- if (isiOS()) {
55
- console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
56
- return RNGroupLinkSDK.startBluetoothIOS();
57
- }
58
- return;
59
- }
60
-
61
- export function setDevicePushTokenIOS(token: string) {
62
- return RNGroupLinkSDK.setDevicePushToken(token);
63
- }
64
-
65
- export function startLocationIOS() {
66
- if (isiOS()) {
67
- console.log('Group Link SDK (iOS) - Start Location Stack');
68
- return RNGroupLinkSDK.startLocationIOS();
69
- }
70
- return;
71
- }
72
-
73
- function isAndroid() {
74
- return Platform.OS == 'android';
75
- }
76
-
77
- function isiOS() {
78
- return Platform.OS == 'ios';
79
- }
80
-
81
- function startAndroid(withToken: string, debbugable: boolean) {
82
- console.log('Group Link SDK (Android) - Start with token: ', withToken);
83
- return RNGroupLinkSDK.startAndroid(withToken, debbugable);
84
- }
85
-
86
- // function getUserIDiOS(success: (userId: string) => void) {
87
- // RNGroupLinkSDK.getUserID(success);
88
- // }
89
-
90
- // function success(userId: string): void {
91
- // throw new Error('Function not implemented.');
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 function startGrouplinkAndroid(token: string, debbugable: boolean) {
21
+ if (isAndroid()) {
22
+ startAndroid(token, debbugable);
23
+ }
24
+ }
25
+
26
+ export async function getUserId(): Promise<string | null> {
27
+ if (isAndroid()) {
28
+ const userID: string = await RNGroupLinkSDK.getUserIdAndroid();
29
+ if(userID != "User not registered yet.") {
30
+ return Promise.resolve(userID);
31
+ } else {
32
+ return Promise.reject("UserID not registered yet")
33
+ }
34
+ }
35
+ if (isiOS()) {
36
+ const userID: string = await RNGroupLinkSDK.getUserID();
37
+ if(userID != null) {
38
+ return Promise.resolve(userID);
39
+ } else {
40
+ return Promise.reject("UserID not registered yet")
41
+ }
42
+ }
43
+ return Promise.reject("Internal Error");
44
+ }
45
+
46
+ export function setFirebaseToken(token: string) {
47
+ if (isAndroid()) {
48
+ console.log('Android: setting firebase token');
49
+ RNGroupLinkSDK.setFirebaseToken(token);
50
+ }
51
+ }
52
+
53
+ export function startBluetoothIOS() {
54
+ if (isiOS()) {
55
+ console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
56
+ return RNGroupLinkSDK.startBluetoothIOS();
57
+ }
58
+ return;
59
+ }
60
+
61
+ export function setDevicePushTokenIOS(token: string) {
62
+ return RNGroupLinkSDK.setDevicePushToken(token);
63
+ }
64
+
65
+ export function startLocationIOS() {
66
+ if (isiOS()) {
67
+ console.log('Group Link SDK (iOS) - Start Location Stack');
68
+ return RNGroupLinkSDK.startLocationIOS();
69
+ }
70
+ return;
71
+ }
72
+
73
+ function isAndroid() {
74
+ return Platform.OS == 'android';
75
+ }
76
+
77
+ function isiOS() {
78
+ return Platform.OS == 'ios';
79
+ }
80
+
81
+ function startAndroid(withToken: string, debbugable: boolean) {
82
+ console.log('Group Link SDK (Android) - Start with token: ', withToken);
83
+ return RNGroupLinkSDK.startAndroid(withToken, debbugable);
84
+ }
85
+
86
+ // function getUserIDiOS(success: (userId: string) => void) {
87
+ // RNGroupLinkSDK.getUserID(success);
88
+ // }
89
+
90
+ // function success(userId: string): void {
91
+ // throw new Error('Function not implemented.');
92
+ // }