@grouplinknetwork/rn-grouplink-sdk 2.1.0 → 2.1.2

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 (44) 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/file-system.probe +0 -0
  19. package/android/.gradle/vcs-1/gc.properties +0 -0
  20. package/android/.idea/compiler.xml +6 -0
  21. package/android/.idea/gradle.xml +19 -0
  22. package/android/.idea/jarRepositories.xml +30 -0
  23. package/android/.idea/misc.xml +10 -0
  24. package/android/.idea/vcs.xml +6 -0
  25. package/android/build.gradle +139 -139
  26. package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  27. package/android/gradle.properties +5 -5
  28. package/android/gradlew +234 -234
  29. package/android/local.properties +8 -0
  30. package/android/src/main/AndroidManifest.xml +24 -24
  31. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +133 -133
  32. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkPackage.java +28 -28
  33. package/grouplink-sdk.podspec +36 -36
  34. package/ios/GrouplinkSdk-Bridging-Header.h +1 -1
  35. package/ios/GrouplinkSdk.m +17 -19
  36. package/ios/GrouplinkSdk.swift +34 -31
  37. package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -283
  38. package/lib/commonjs/index.js +1 -1
  39. package/lib/commonjs/index.js.map +1 -1
  40. package/lib/module/index.js +1 -1
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/typescript/index.d.ts +6 -6
  43. package/package.json +131 -131
  44. package/src/index.tsx +92 -92
@@ -1,6 +1,6 @@
1
- export declare function startGrouplinkAndroid(token: string, debbugable: boolean): void;
2
- export declare function getUserId(): Promise<string | null>;
3
- export declare function setFirebaseToken(token: string): void;
4
- export declare function startBluetoothIOS(): any;
5
- export declare function setDevicePushTokenIOS(token: string): any;
6
- export declare function startLocationIOS(): any;
1
+ export declare function startGrouplinkAndroid(token: string, debbugable: boolean): void;
2
+ export declare function getUserId(): Promise<string | null>;
3
+ export declare function setFirebaseToken(token: string): void;
4
+ export declare function startBluetoothIOS(): any;
5
+ export declare function setDevicePushTokenIOS(token: string): any;
6
+ export declare function startLocationIOS(): any;
package/package.json CHANGED
@@ -1,131 +1,131 @@
1
- {
2
- "name": "@grouplinknetwork/rn-grouplink-sdk",
3
- "version": "2.1.0",
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": "^17.0.2",
53
- "@react-native-community/eslint-config": "^3.0.2",
54
- "@release-it/conventional-changelog": "^5.0.0",
55
- "@types/jest": "^28.1.2",
56
- "@types/react": "~17.0.21",
57
- "@types/react-native": "0.68.0",
58
- "babel-eslint": "^10.1.0",
59
- "commitlint": "^17.0.2",
60
- "eslint": "^8.4.1",
61
- "eslint-config-prettier": "^8.5.0",
62
- "eslint-plugin-prettier": "^4.0.0",
63
- "jest": "^28.1.1",
64
- "pod-install": "^0.1.0",
65
- "prettier": "^2.0.5",
66
- "react": "17.0.2",
67
- "react-native": "0.68.2",
68
- "react-native-builder-bob": "^0.18.3",
69
- "release-it": "^15.3.0",
70
- "typescript": "^4.7.4"
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.1.2",
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": "^17.0.2",
53
+ "@react-native-community/eslint-config": "^3.0.2",
54
+ "@release-it/conventional-changelog": "^5.0.0",
55
+ "@types/jest": "^28.1.2",
56
+ "@types/react": "~17.0.21",
57
+ "@types/react-native": "0.68.0",
58
+ "babel-eslint": "^10.1.0",
59
+ "commitlint": "^17.0.2",
60
+ "eslint": "^8.4.1",
61
+ "eslint-config-prettier": "^8.5.0",
62
+ "eslint-plugin-prettier": "^4.0.0",
63
+ "jest": "^28.1.1",
64
+ "pod-install": "^0.1.0",
65
+ "prettier": "^2.0.5",
66
+ "react": "17.0.2",
67
+ "react-native": "0.68.2",
68
+ "react-native-builder-bob": "^0.18.3",
69
+ "release-it": "^15.3.0",
70
+ "typescript": "^4.7.4"
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 = 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
+ // }