@grouplinknetwork/rn-grouplink-sdk 1.2.2 → 1.2.3
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 +7 -29
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4.2/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.4.2/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.idea/gradle.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/modules/android.iml +18 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +149 -149
- package/android/gradle.properties +5 -5
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +24 -24
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +133 -120
- 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 +16 -16
- package/ios/GrouplinkSdk.swift +30 -30
- package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -283
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +6 -5
- package/package.json +131 -130
- package/src/index.tsx +86 -72
- package/android/libs/lib-grouplink-debug_v3_14_1.aar +0 -0
- package/android/libs/lib-grouplink-release_v3_14_1.aar +0 -0
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","startGrouplink","token","debbugable","isAndroid","startAndroid","isiOS","startIOS","setFirebaseToken","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","withToken"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst RNGroupLinkSDK = NativeModules.RNGroupLinkSDK\n ? NativeModules.RNGroupLinkSDK\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function startGrouplink(token: string, debbugable: boolean) {\n if (isAndroid()) {\n startAndroid(token, debbugable);\n }\n if (isiOS()) {\n startIOS(token);\n }\n}\n\nexport function setFirebaseToken(token: string){\n if(isAndroid()){\n console.log(\"Android: setting firebase token\")\n RNGroupLinkSDK.setFirebaseToken(token);\n }\n}\n\nexport function startBluetoothIOS() {\n if (isiOS()) {\n console.log('Group Link SDK (iOS) - Start Bluetooth Stack');\n return RNGroupLinkSDK.startBluetoothIOS();\n }\n return;\n}\n\nexport function setDevicePushTokenIOS(token: string) {\n return RNGroupLinkSDK.setDevicePushToken(token)\n}\n\nexport function startLocationIOS() {\n if (isiOS()) {\n console.log('Group Link SDK (iOS) - Start Location Stack');\n return RNGroupLinkSDK.startLocationIOS();\n }\n return;\n}\n\nfunction isAndroid() {\n return Platform.OS == 'android';\n}\n\nfunction isiOS() {\n return Platform.OS == 'ios';\n}\n\nfunction startAndroid(withToken: string, debbugable: boolean) {\n console.log('Group Link SDK (Android) - Start with token: ', withToken);\n return RNGroupLinkSDK.startAndroid(withToken, debbugable);\n}\n\nfunction startIOS(withToken: string) {\n console.log('Group Link SDK (iOS) - Start with token: ', withToken);\n return RNGroupLinkSDK.startIOS(withToken);\n}\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,wEAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAd,GACnBN,aAAa,CAACM,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,cAAT,CAAwBC,KAAxB,EAAuCC,UAAvC,EAA4D;EACjE,IAAIC,SAAS,EAAb,EAAiB;IACfC,YAAY,CAACH,KAAD,EAAQC,UAAR,CAAZ;EACD;;EACD,IAAIG,KAAK,EAAT,EAAa;IACXC,QAAQ,CAACL,KAAD,CAAR;EACD;AACF;AAED,OAAO,SAASM,gBAAT,
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","startGrouplink","token","debbugable","isAndroid","startAndroid","isiOS","startIOS","getUserId","success","getUserIdAndroid","setFirebaseToken","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","withToken"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\r\n\r\nconst LINKING_ERROR =\r\n `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \\n\\n` +\r\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\r\n '- You rebuilt the app after installing the package\\n' +\r\n '- You are not using Expo managed workflow\\n';\r\n\r\nconst RNGroupLinkSDK = NativeModules.RNGroupLinkSDK\r\n ? NativeModules.RNGroupLinkSDK\r\n : new Proxy(\r\n {},\r\n {\r\n get() {\r\n throw new Error(LINKING_ERROR);\r\n },\r\n }\r\n );\r\n\r\nexport function startGrouplink(token: string, debbugable: boolean) {\r\n if (isAndroid()) {\r\n startAndroid(token, debbugable);\r\n }\r\n if (isiOS()) {\r\n startIOS(token);\r\n }\r\n}\r\n\r\nexport function getUserId(success: (userId:string)=>void) {\r\n if (isAndroid()) {\r\n getUserIdAndroid(success)\r\n }\r\n if (isiOS()) {\r\n \r\n }\r\n}\r\n\r\nexport function setFirebaseToken(token: string){\r\n if(isAndroid()){\r\n console.log(\"Android: setting firebase token\")\r\n RNGroupLinkSDK.setFirebaseToken(token);\r\n }\r\n}\r\n\r\nexport function startBluetoothIOS() {\r\n if (isiOS()) {\r\n console.log('Group Link SDK (iOS) - Start Bluetooth Stack');\r\n return RNGroupLinkSDK.startBluetoothIOS();\r\n }\r\n return;\r\n}\r\n\r\nexport function setDevicePushTokenIOS(token: string) {\r\n return RNGroupLinkSDK.setDevicePushToken(token)\r\n}\r\n\r\nexport function startLocationIOS() {\r\n if (isiOS()) {\r\n console.log('Group Link SDK (iOS) - Start Location Stack');\r\n return RNGroupLinkSDK.startLocationIOS();\r\n }\r\n return;\r\n}\r\n\r\nfunction isAndroid() {\r\n return Platform.OS == 'android';\r\n}\r\n\r\nfunction isiOS() {\r\n return Platform.OS == 'ios';\r\n}\r\n\r\nfunction startAndroid(withToken: string, debbugable: boolean) {\r\n console.log('Group Link SDK (Android) - Start with token: ', withToken);\r\n return RNGroupLinkSDK.startAndroid(withToken, debbugable);\r\n}\r\n\r\nfunction startIOS(withToken: string) {\r\n console.log('Group Link SDK (iOS) - Start with token: ', withToken);\r\n return RNGroupLinkSDK.startIOS(withToken);\r\n}\r\nfunction getUserIdAndroid(success: (userId:string)=>void) {\r\n RNGroupLinkSDK.getUserIdAndroid(success);\r\n}\r\n\r\n\r\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,wEAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAd,GACnBN,aAAa,CAACM,cADK,GAEnB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,cAAT,CAAwBC,KAAxB,EAAuCC,UAAvC,EAA4D;EACjE,IAAIC,SAAS,EAAb,EAAiB;IACfC,YAAY,CAACH,KAAD,EAAQC,UAAR,CAAZ;EACD;;EACD,IAAIG,KAAK,EAAT,EAAa;IACXC,QAAQ,CAACL,KAAD,CAAR;EACD;AACF;AAED,OAAO,SAASM,SAAT,CAAmBC,OAAnB,EAAmD;EACxD,IAAIL,SAAS,EAAb,EAAiB;IACfM,gBAAgB,CAACD,OAAD,CAAhB;EACD;;EACD,IAAIH,KAAK,EAAT,EAAa,CAEZ;AACF;AAED,OAAO,SAASK,gBAAT,CAA0BT,KAA1B,EAAwC;EAC7C,IAAGE,SAAS,EAAZ,EAAe;IACbQ,OAAO,CAACC,GAAR,CAAY,iCAAZ;IACAhB,cAAc,CAACc,gBAAf,CAAgCT,KAAhC;EACD;AACF;AAED,OAAO,SAASY,iBAAT,GAA6B;EAClC,IAAIR,KAAK,EAAT,EAAa;IACXM,OAAO,CAACC,GAAR,CAAY,8CAAZ;IACA,OAAOhB,cAAc,CAACiB,iBAAf,EAAP;EACD;;EACD;AACD;AAED,OAAO,SAASC,qBAAT,CAA+Bb,KAA/B,EAA8C;EACnD,OAAOL,cAAc,CAACmB,kBAAf,CAAkCd,KAAlC,CAAP;AACD;AAED,OAAO,SAASe,gBAAT,GAA4B;EACjC,IAAIX,KAAK,EAAT,EAAa;IACXM,OAAO,CAACC,GAAR,CAAY,6CAAZ;IACA,OAAOhB,cAAc,CAACoB,gBAAf,EAAP;EACD;;EACD;AACD;;AAED,SAASb,SAAT,GAAqB;EACnB,OAAOZ,QAAQ,CAAC0B,EAAT,IAAe,SAAtB;AACD;;AAED,SAASZ,KAAT,GAAiB;EACf,OAAOd,QAAQ,CAAC0B,EAAT,IAAe,KAAtB;AACD;;AAED,SAASb,YAAT,CAAsBc,SAAtB,EAAyChB,UAAzC,EAA8D;EAC5DS,OAAO,CAACC,GAAR,CAAY,+CAAZ,EAA6DM,SAA7D;EACA,OAAOtB,cAAc,CAACQ,YAAf,CAA4Bc,SAA5B,EAAuChB,UAAvC,CAAP;AACD;;AAED,SAASI,QAAT,CAAkBY,SAAlB,EAAqC;EACnCP,OAAO,CAACC,GAAR,CAAY,2CAAZ,EAAyDM,SAAzD;EACA,OAAOtB,cAAc,CAACU,QAAf,CAAwBY,SAAxB,CAAP;AACD;;AACD,SAAST,gBAAT,CAA0BD,OAA1B,EAA0D;EACxDZ,cAAc,CAACa,gBAAf,CAAgCD,OAAhC;AACD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare function startGrouplink(token: string, debbugable: boolean): void;
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
1
|
+
export declare function startGrouplink(token: string, debbugable: boolean): void;
|
|
2
|
+
export declare function getUserId(success: (userId: string) => void): void;
|
|
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,130 +1,131 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@grouplinknetwork/rn-grouplink-sdk",
|
|
3
|
-
"version": "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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@
|
|
51
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/react
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"eslint
|
|
61
|
-
"eslint-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"react
|
|
67
|
-
"react-native
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"react
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"<rootDir>/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@grouplinknetwork/rn-grouplink-sdk",
|
|
3
|
+
"version": "1.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": "^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,72 +1,86 @@
|
|
|
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 startGrouplink(token: string, debbugable: boolean) {
|
|
21
|
-
if (isAndroid()) {
|
|
22
|
-
startAndroid(token, debbugable);
|
|
23
|
-
}
|
|
24
|
-
if (isiOS()) {
|
|
25
|
-
startIOS(token);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function
|
|
30
|
-
if(isAndroid()){
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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 startGrouplink(token: string, debbugable: boolean) {
|
|
21
|
+
if (isAndroid()) {
|
|
22
|
+
startAndroid(token, debbugable);
|
|
23
|
+
}
|
|
24
|
+
if (isiOS()) {
|
|
25
|
+
startIOS(token);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function getUserId(success: (userId:string)=>void) {
|
|
30
|
+
if (isAndroid()) {
|
|
31
|
+
getUserIdAndroid(success)
|
|
32
|
+
}
|
|
33
|
+
if (isiOS()) {
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function setFirebaseToken(token: string){
|
|
39
|
+
if(isAndroid()){
|
|
40
|
+
console.log("Android: setting firebase token")
|
|
41
|
+
RNGroupLinkSDK.setFirebaseToken(token);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function startBluetoothIOS() {
|
|
46
|
+
if (isiOS()) {
|
|
47
|
+
console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
|
|
48
|
+
return RNGroupLinkSDK.startBluetoothIOS();
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function setDevicePushTokenIOS(token: string) {
|
|
54
|
+
return RNGroupLinkSDK.setDevicePushToken(token)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function startLocationIOS() {
|
|
58
|
+
if (isiOS()) {
|
|
59
|
+
console.log('Group Link SDK (iOS) - Start Location Stack');
|
|
60
|
+
return RNGroupLinkSDK.startLocationIOS();
|
|
61
|
+
}
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isAndroid() {
|
|
66
|
+
return Platform.OS == 'android';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isiOS() {
|
|
70
|
+
return Platform.OS == 'ios';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function startAndroid(withToken: string, debbugable: boolean) {
|
|
74
|
+
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
75
|
+
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function startIOS(withToken: string) {
|
|
79
|
+
console.log('Group Link SDK (iOS) - Start with token: ', withToken);
|
|
80
|
+
return RNGroupLinkSDK.startIOS(withToken);
|
|
81
|
+
}
|
|
82
|
+
function getUserIdAndroid(success: (userId:string)=>void) {
|
|
83
|
+
RNGroupLinkSDK.getUserIdAndroid(success);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
Binary file
|
|
Binary file
|