@grouplinknetwork/rn-grouplink-sdk 1.4.0 → 2.0.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.
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +3 -3
- package/ios/GrouplinkSdk.m +3 -0
- package/ios/GrouplinkSdk.swift +5 -4
- package/lib/commonjs/index.js +20 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +19 -15
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.tsx +18 -19
- 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/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 -18
- package/android/.idea/jarRepositories.xml +0 -30
- package/android/.idea/misc.xml +0 -5
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
package/android/build.gradle
CHANGED
|
@@ -115,7 +115,7 @@ repositories {
|
|
|
115
115
|
})
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
if (!found) {
|
|
118
|
+
if (!found) {npm
|
|
119
119
|
throw new GradleException(
|
|
120
120
|
"${project.name}: unable to locate React Native android sources. " +
|
|
121
121
|
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
@@ -127,7 +127,7 @@ repositories {
|
|
|
127
127
|
dependencies {
|
|
128
128
|
//noinspection GradleDynamicVersion
|
|
129
129
|
implementation "com.facebook.react:react-native:+"
|
|
130
|
-
implementation 'com.grouplinknetwork:lib-grouplinknetwork:3.
|
|
130
|
+
implementation 'com.grouplinknetwork:lib-grouplinknetwork:3.27.2'
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
if (isNewArchitectureEnabled()) {
|
|
@@ -46,15 +46,15 @@ public class GrouplinkSdkModule extends ReactContextBaseJavaModule implements Li
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
@ReactMethod
|
|
49
|
-
public void getUserIdAndroid(
|
|
49
|
+
public void getUserIdAndroid(Promise promise){
|
|
50
50
|
Context context = mReactApplicationContext.getApplicationContext();
|
|
51
51
|
String userId = "undefined usrId";
|
|
52
52
|
try{
|
|
53
53
|
userId = GroupLink.getUserId(context);
|
|
54
|
-
|
|
54
|
+
promise.resolve(userId);
|
|
55
55
|
}catch(Exception e){
|
|
56
56
|
e.printStackTrace();
|
|
57
|
-
|
|
57
|
+
promise.resolve("not registered");
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
package/ios/GrouplinkSdk.m
CHANGED
|
@@ -7,6 +7,9 @@ RCT_EXTERN_METHOD(startBluetoothIOS)
|
|
|
7
7
|
RCT_EXTERN_METHOD(checkBluetoothIOS)
|
|
8
8
|
RCT_EXTERN_METHOD(startLocationIOS)
|
|
9
9
|
RCT_EXTERN_METHOD(setDevicePushToken:(NSString)withPushToken)
|
|
10
|
+
RCT_EXTERN_METHOD(getUserID:
|
|
11
|
+
(RCTPromiseResolveBlock)resolve
|
|
12
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
10
13
|
|
|
11
14
|
+ (BOOL)requiresMainQueueSetup
|
|
12
15
|
{
|
package/ios/GrouplinkSdk.swift
CHANGED
|
@@ -3,10 +3,6 @@ import GroupLink
|
|
|
3
3
|
|
|
4
4
|
@objc(RNGroupLinkSDK)
|
|
5
5
|
class RNGroupLinkSDK: NSObject {
|
|
6
|
-
@objc(startIOS:)
|
|
7
|
-
func startIOS(withToken: String) -> Void {
|
|
8
|
-
GroupLinkSDK.start(token: withToken)
|
|
9
|
-
}
|
|
10
6
|
|
|
11
7
|
@objc(setDevicePushToken:)
|
|
12
8
|
func setDevicePushToken(withPushToken: String) -> Void {
|
|
@@ -27,4 +23,9 @@ class RNGroupLinkSDK: NSObject {
|
|
|
27
23
|
func checkBluetoothIOS() -> Void {
|
|
28
24
|
GroupLinkSDK.checkBluetooth()
|
|
29
25
|
}
|
|
26
|
+
|
|
27
|
+
@objc(getUserID:rejecter:)
|
|
28
|
+
func getUserID(_ resolve: RCTPromiseResolveBlock, rejecter reject:RCTPromiseRejectBlock) -> Void {
|
|
29
|
+
resolve(GroupLinkSDK.getUserID())
|
|
30
|
+
}
|
|
30
31
|
}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getUserId = getUserId;
|
|
|
7
7
|
exports.setDevicePushTokenIOS = setDevicePushTokenIOS;
|
|
8
8
|
exports.setFirebaseToken = setFirebaseToken;
|
|
9
9
|
exports.startBluetoothIOS = startBluetoothIOS;
|
|
10
|
-
exports.
|
|
10
|
+
exports.startGrouplinkAndroid = startGrouplinkAndroid;
|
|
11
11
|
exports.startLocationIOS = startLocationIOS;
|
|
12
12
|
var _reactNative = require("react-native");
|
|
13
13
|
const LINKING_ERROR = `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
@@ -19,23 +19,23 @@ const RNGroupLinkSDK = _reactNative.NativeModules.RNGroupLinkSDK ? _reactNative.
|
|
|
19
19
|
throw new Error(LINKING_ERROR);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
function
|
|
22
|
+
function startGrouplinkAndroid(token, debbugable) {
|
|
23
23
|
if (isAndroid()) {
|
|
24
24
|
startAndroid(token, debbugable);
|
|
25
25
|
}
|
|
26
|
-
if (isiOS()) {
|
|
27
|
-
startIOS(token);
|
|
28
|
-
}
|
|
29
26
|
}
|
|
30
|
-
function getUserId(
|
|
27
|
+
function getUserId() {
|
|
31
28
|
if (isAndroid()) {
|
|
32
|
-
getUserIdAndroid(
|
|
29
|
+
return RNGroupLinkSDK.getUserIdAndroid();
|
|
30
|
+
}
|
|
31
|
+
if (isiOS()) {
|
|
32
|
+
return RNGroupLinkSDK.getUserID();
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
return Promise.resolve(null);
|
|
35
35
|
}
|
|
36
36
|
function setFirebaseToken(token) {
|
|
37
37
|
if (isAndroid()) {
|
|
38
|
-
console.log(
|
|
38
|
+
console.log('Android: setting firebase token');
|
|
39
39
|
RNGroupLinkSDK.setFirebaseToken(token);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -66,11 +66,15 @@ function startAndroid(withToken, debbugable) {
|
|
|
66
66
|
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
67
67
|
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
}
|
|
69
|
+
// function getUserIdAndroid(success: (userId: string) => void) {
|
|
70
|
+
// RNGroupLinkSDK.getUserIdAndroid(success);
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
// function getUserIDiOS(success: (userId: string) => void) {
|
|
74
|
+
// RNGroupLinkSDK.getUserID(success);
|
|
75
|
+
// }
|
|
76
|
+
|
|
77
|
+
// function success(userId: string): void {
|
|
78
|
+
// throw new Error('Function not implemented.');
|
|
79
|
+
// }
|
|
76
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RNGroupLinkSDK","NativeModules","Proxy","get","Error","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RNGroupLinkSDK","NativeModules","Proxy","get","Error","startGrouplinkAndroid","token","debbugable","isAndroid","startAndroid","getUserId","getUserIdAndroid","isiOS","getUserID","Promise","resolve","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 startGrouplinkAndroid(token: string, debbugable: boolean) {\n if (isAndroid()) {\n startAndroid(token, debbugable);\n }\n}\n\nexport function getUserId(): Promise<number | null> {\n if (isAndroid()) {\n return RNGroupLinkSDK.getUserIdAndroid();\n }\n if (isiOS()) {\n return RNGroupLinkSDK.getUserID();\n }\n return Promise.resolve(null);\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// function getUserIdAndroid(success: (userId: string) => void) {\n// RNGroupLinkSDK.getUserIdAndroid(success);\n// }\n\n// function getUserIDiOS(success: (userId: string) => void) {\n// RNGroupLinkSDK.getUserID(success);\n// }\n\n// function success(userId: string): void {\n// throw new Error('Function not implemented.');\n// }\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,wEAAuE,GACxEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc,GAC/CC,0BAAa,CAACD,cAAc,GAC5B,IAAIE,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,SAASU,qBAAqBA,CAACC,KAAa,EAAEC,UAAmB,EAAE;EACxE,IAAIC,SAAS,CAAC,CAAC,EAAE;IACfC,YAAY,CAACH,KAAK,EAAEC,UAAU,CAAC;EACjC;AACF;AAEO,SAASG,SAASA,CAAA,EAA2B;EAClD,IAAIF,SAAS,CAAC,CAAC,EAAE;IACf,OAAOR,cAAc,CAACW,gBAAgB,CAAC,CAAC;EAC1C;EACA,IAAIC,KAAK,CAAC,CAAC,EAAE;IACX,OAAO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NativeModules.RNGroupLinkS
|
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
export function
|
|
11
|
+
export function startGrouplinkAndroid(token, debbugable) {
|
|
12
12
|
if (isAndroid()) {
|
|
13
13
|
startAndroid(token, debbugable);
|
|
14
14
|
}
|
|
15
|
-
if (isiOS()) {
|
|
16
|
-
startIOS(token);
|
|
17
|
-
}
|
|
18
15
|
}
|
|
19
|
-
export function getUserId(
|
|
16
|
+
export function getUserId() {
|
|
20
17
|
if (isAndroid()) {
|
|
21
|
-
getUserIdAndroid(
|
|
18
|
+
return RNGroupLinkSDK.getUserIdAndroid();
|
|
19
|
+
}
|
|
20
|
+
if (isiOS()) {
|
|
21
|
+
return RNGroupLinkSDK.getUserID();
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
return Promise.resolve(null);
|
|
24
24
|
}
|
|
25
25
|
export function setFirebaseToken(token) {
|
|
26
26
|
if (isAndroid()) {
|
|
27
|
-
console.log(
|
|
27
|
+
console.log('Android: setting firebase token');
|
|
28
28
|
RNGroupLinkSDK.setFirebaseToken(token);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -55,11 +55,15 @@ function startAndroid(withToken, debbugable) {
|
|
|
55
55
|
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
56
56
|
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
}
|
|
58
|
+
// function getUserIdAndroid(success: (userId: string) => void) {
|
|
59
|
+
// RNGroupLinkSDK.getUserIdAndroid(success);
|
|
60
|
+
// }
|
|
61
|
+
|
|
62
|
+
// function getUserIDiOS(success: (userId: string) => void) {
|
|
63
|
+
// RNGroupLinkSDK.getUserID(success);
|
|
64
|
+
// }
|
|
65
|
+
|
|
66
|
+
// function success(userId: string): void {
|
|
67
|
+
// throw new Error('Function not implemented.');
|
|
68
|
+
// }
|
|
65
69
|
//# sourceMappingURL=index.js.map
|
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","startGrouplinkAndroid","token","debbugable","isAndroid","startAndroid","getUserId","getUserIdAndroid","isiOS","getUserID","Promise","resolve","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 startGrouplinkAndroid(token: string, debbugable: boolean) {\n if (isAndroid()) {\n startAndroid(token, debbugable);\n }\n}\n\nexport function getUserId(): Promise<number | null> {\n if (isAndroid()) {\n return RNGroupLinkSDK.getUserIdAndroid();\n }\n if (isiOS()) {\n return RNGroupLinkSDK.getUserID();\n }\n return Promise.resolve(null);\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// function getUserIdAndroid(success: (userId: string) => void) {\n// RNGroupLinkSDK.getUserIdAndroid(success);\n// }\n\n// function getUserIDiOS(success: (userId: string) => void) {\n// RNGroupLinkSDK.getUserID(success);\n// }\n\n// function success(userId: string): void {\n// throw new Error('Function not implemented.');\n// }\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,wEAAuE,GACxED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAc,GAC/CN,aAAa,CAACM,cAAc,GAC5B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,OAAO,SAASQ,qBAAqBA,CAACC,KAAa,EAAEC,UAAmB,EAAE;EACxE,IAAIC,SAAS,CAAC,CAAC,EAAE;IACfC,YAAY,CAACH,KAAK,EAAEC,UAAU,CAAC;EACjC;AACF;AAEA,OAAO,SAASG,SAASA,CAAA,EAA2B;EAClD,IAAIF,SAAS,CAAC,CAAC,EAAE;IACf,OAAOP,cAAc,CAACU,gBAAgB,CAAC,CAAC;EAC1C;EACA,IAAIC,KAAK,CAAC,CAAC,EAAE;IACX,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export declare function getUserId(
|
|
1
|
+
export declare function startGrouplinkAndroid(token: string, debbugable: boolean): void;
|
|
2
|
+
export declare function getUserId(): Promise<number | null>;
|
|
3
3
|
export declare function setFirebaseToken(token: string): void;
|
|
4
4
|
export declare function startBluetoothIOS(): any;
|
|
5
5
|
export declare function setDevicePushTokenIOS(token: string): any;
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -17,27 +17,25 @@ const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
export function
|
|
20
|
+
export function startGrouplinkAndroid(token: string, debbugable: boolean) {
|
|
21
21
|
if (isAndroid()) {
|
|
22
22
|
startAndroid(token, debbugable);
|
|
23
23
|
}
|
|
24
|
-
if (isiOS()) {
|
|
25
|
-
startIOS(token);
|
|
26
|
-
}
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
export function getUserId(
|
|
26
|
+
export function getUserId(): Promise<number | null> {
|
|
30
27
|
if (isAndroid()) {
|
|
31
|
-
getUserIdAndroid(
|
|
28
|
+
return RNGroupLinkSDK.getUserIdAndroid();
|
|
32
29
|
}
|
|
33
30
|
if (isiOS()) {
|
|
34
|
-
|
|
31
|
+
return RNGroupLinkSDK.getUserID();
|
|
35
32
|
}
|
|
33
|
+
return Promise.resolve(null);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
export function setFirebaseToken(token: string){
|
|
39
|
-
if(isAndroid()){
|
|
40
|
-
console.log(
|
|
36
|
+
export function setFirebaseToken(token: string) {
|
|
37
|
+
if (isAndroid()) {
|
|
38
|
+
console.log('Android: setting firebase token');
|
|
41
39
|
RNGroupLinkSDK.setFirebaseToken(token);
|
|
42
40
|
}
|
|
43
41
|
}
|
|
@@ -51,7 +49,7 @@ export function startBluetoothIOS() {
|
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export function setDevicePushTokenIOS(token: string) {
|
|
54
|
-
return RNGroupLinkSDK.setDevicePushToken(token)
|
|
52
|
+
return RNGroupLinkSDK.setDevicePushToken(token);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
export function startLocationIOS() {
|
|
@@ -74,13 +72,14 @@ function startAndroid(withToken: string, debbugable: boolean) {
|
|
|
74
72
|
console.log('Group Link SDK (Android) - Start with token: ', withToken);
|
|
75
73
|
return RNGroupLinkSDK.startAndroid(withToken, debbugable);
|
|
76
74
|
}
|
|
75
|
+
// function getUserIdAndroid(success: (userId: string) => void) {
|
|
76
|
+
// RNGroupLinkSDK.getUserIdAndroid(success);
|
|
77
|
+
// }
|
|
77
78
|
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
function getUserIdAndroid(success: (userId:string)=>void) {
|
|
83
|
-
RNGroupLinkSDK.getUserIdAndroid(success);
|
|
84
|
-
}
|
|
85
|
-
|
|
79
|
+
// function getUserIDiOS(success: (userId: string) => void) {
|
|
80
|
+
// RNGroupLinkSDK.getUserID(success);
|
|
81
|
+
// }
|
|
86
82
|
|
|
83
|
+
// function success(userId: string): void {
|
|
84
|
+
// throw new Error('Function not implemented.');
|
|
85
|
+
// }
|
|
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,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="GradleSettings">
|
|
4
|
-
<option name="linkedExternalProjectsSettings">
|
|
5
|
-
<GradleProjectSettings>
|
|
6
|
-
<option name="testRunner" value="GRADLE" />
|
|
7
|
-
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
8
|
-
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
9
|
-
<option name="gradleJvm" value="Embedded JDK" />
|
|
10
|
-
<option name="modules">
|
|
11
|
-
<set>
|
|
12
|
-
<option value="$PROJECT_DIR$" />
|
|
13
|
-
</set>
|
|
14
|
-
</option>
|
|
15
|
-
</GradleProjectSettings>
|
|
16
|
-
</option>
|
|
17
|
-
</component>
|
|
18
|
-
</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,5 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
-
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK" />
|
|
5
|
-
</project>
|
package/android/.idea/vcs.xml
DELETED
package/android/local.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
-
# as it contains information specific to your local configuration.
|
|
3
|
-
#
|
|
4
|
-
# Location of the SDK. This is only used by Gradle.
|
|
5
|
-
# For customization when using a Version Control System, please read the
|
|
6
|
-
# header note.
|
|
7
|
-
#Wed Apr 26 19:58:04 BRT 2023
|
|
8
|
-
sdk.dir=/Users/vitorhugo/Library/Android/sdk
|