@grouplinknetwork/rn-grouplink-sdk 2.5.1 → 2.7.0-beta.1

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 (52) hide show
  1. package/README.md +0 -12
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +46 -0
  4. package/grouplink-sdk.podspec +5 -1
  5. package/ios/Frameworks/GroupLink.xcframework/Info.plist +44 -0
  6. package/ios/Frameworks/GroupLink.xcframework/_CodeSignature/CodeDirectory +0 -0
  7. package/ios/Frameworks/GroupLink.xcframework/_CodeSignature/CodeRequirements +0 -0
  8. package/ios/Frameworks/GroupLink.xcframework/_CodeSignature/CodeResources +574 -0
  9. package/ios/Frameworks/GroupLink.xcframework/_CodeSignature/CodeSignature +0 -0
  10. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/GroupLink +0 -0
  11. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink-Swift.h +443 -0
  12. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Headers/GroupLink.h +18 -0
  13. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Info.plist +0 -0
  14. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.abi.json +6487 -0
  15. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.private.swiftinterface +90 -0
  16. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  17. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios.swiftinterface +90 -0
  18. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/Modules/module.modulemap +10 -0
  19. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/PrivacyInfo.xcprivacy +74 -0
  20. package/ios/Frameworks/GroupLink.xcframework/ios-arm64/GroupLink.framework/_CodeSignature/CodeResources +201 -0
  21. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/GroupLink +0 -0
  22. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink-Swift.h +882 -0
  23. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Headers/GroupLink.h +18 -0
  24. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Info.plist +0 -0
  25. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.abi.json +6487 -0
  26. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +90 -0
  27. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  28. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/arm64-apple-ios-simulator.swiftinterface +90 -0
  29. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.abi.json +6487 -0
  30. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +90 -0
  31. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  32. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/GroupLink.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +90 -0
  33. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/Modules/module.modulemap +10 -0
  34. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/PrivacyInfo.xcprivacy +74 -0
  35. package/ios/Frameworks/GroupLink.xcframework/ios-arm64_x86_64-simulator/GroupLink.framework/_CodeSignature/CodeResources +256 -0
  36. package/ios/GrouplinkSdk.mm +34 -2
  37. package/ios/GrouplinkSdk.swift +11 -1
  38. package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/xcuserdata/gabrieltorelo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  39. package/ios/GrouplinkSdk.xcodeproj/xcuserdata/gabrieltorelo.xcuserdatad/xcschemes/xcschememanagement.plist +8 -0
  40. package/lib/commonjs/NativeGrouplinkSdk.js.map +1 -1
  41. package/lib/commonjs/index.js +63 -13
  42. package/lib/commonjs/index.js.map +1 -1
  43. package/lib/module/NativeGrouplinkSdk.js.map +1 -1
  44. package/lib/module/index.js +61 -13
  45. package/lib/module/index.js.map +1 -1
  46. package/lib/typescript/NativeGrouplinkSdk.d.ts +16 -0
  47. package/lib/typescript/NativeGrouplinkSdk.d.ts.map +1 -1
  48. package/lib/typescript/index.d.ts +26 -3
  49. package/lib/typescript/index.d.ts.map +1 -1
  50. package/package.json +1 -1
  51. package/src/NativeGrouplinkSdk.ts +16 -0
  52. package/src/index.tsx +64 -13
package/src/index.tsx CHANGED
@@ -16,6 +16,19 @@ export async function getUserId(): Promise<string | null> {
16
16
  return Promise.reject('Internal Error');
17
17
  }
18
18
 
19
+ export async function getDeviceKey(): Promise<string | null> {
20
+ if (_isAndroid()) {
21
+ return await NativeGroupLinkSDK.getDeviceKeyAndroid().catch(() => 'Device Key not available yet');
22
+ } else if (_isiOS()) {
23
+ return await NativeGroupLinkSDK.getDeviceKeyIOS().catch(() => 'Device Key not available yet');
24
+ }
25
+
26
+ return "Device Key not available yet";
27
+ }
28
+
29
+ /**
30
+ * @deprecated No longer supported.
31
+ */
19
32
  export function setFirebaseToken(token: string) {
20
33
  if (token == null || token === '') {
21
34
  _reportError(
@@ -37,6 +50,9 @@ export function startBluetoothIOS() {
37
50
  }
38
51
  }
39
52
 
53
+ /**
54
+ * @deprecated No longer supported.
55
+ */
40
56
  export function setDevicePushTokenIOS(token: string) {
41
57
  if (token == null || token === '') {
42
58
  _reportError(
@@ -58,10 +74,10 @@ export function startLocationIOS() {
58
74
  }
59
75
  }
60
76
 
61
- export function startGrouplink(withToken: string, debbugable?: boolean | null) {
62
- if (withToken == null || withToken === '') {
77
+ export function startGrouplink(appLabel: string, debbugable?: boolean | null) {
78
+ if (appLabel == null || appLabel === '') {
63
79
  _reportError(
64
- 'startGrouplink(withToken: string, debbugable?: boolean | null)',
80
+ 'startGrouplink(appLabel: string, debbugable?: boolean | null)',
65
81
  'Requires a valid GroupLink token string.'
66
82
  );
67
83
 
@@ -71,16 +87,16 @@ export function startGrouplink(withToken: string, debbugable?: boolean | null) {
71
87
  const debug = debbugable ?? false;
72
88
 
73
89
  if (_isiOS()) {
74
- NativeGroupLinkSDK.startIOS(withToken);
90
+ NativeGroupLinkSDK.startIOS(appLabel);
75
91
  } else if (_isAndroid()) {
76
- NativeGroupLinkSDK.startAndroid(withToken, debug);
92
+ NativeGroupLinkSDK.startAndroid(appLabel, debug);
77
93
  }
78
94
  }
79
95
 
80
- export function startGrouplinkAndroid(withToken: string, debbugable?: boolean | null) {
81
- if (withToken == null || withToken === '') {
96
+ export function startGrouplinkAndroid(appLabel: string, debbugable?: boolean | null) {
97
+ if (appLabel == null || appLabel === '') {
82
98
  _reportError(
83
- 'startGrouplinkAndroid(withToken: string, debbugable?: boolean | null)',
99
+ 'startGrouplinkAndroid(appLabel: string, debbugable?: boolean | null)',
84
100
  'Requires a valid GroupLink token string.'
85
101
  );
86
102
 
@@ -90,14 +106,14 @@ export function startGrouplinkAndroid(withToken: string, debbugable?: boolean |
90
106
  const debug = debbugable ?? false;
91
107
 
92
108
  if (_isAndroid()) {
93
- NativeGroupLinkSDK.startAndroid(withToken, debug);
109
+ NativeGroupLinkSDK.startAndroid(appLabel, debug);
94
110
  }
95
111
  }
96
112
 
97
- export function startGrouplinkIOS(withToken: string) {
98
- if (withToken == null || withToken === '') {
113
+ export function startGrouplinkIOS(appLabel: string) {
114
+ if (appLabel == null || appLabel === '') {
99
115
  _reportError(
100
- 'startGrouplinkIOS(withToken: string)',
116
+ 'startGrouplinkIOS(appLabel: string)',
101
117
  'Requires a valid GroupLink token string.'
102
118
  );
103
119
 
@@ -105,7 +121,7 @@ export function startGrouplinkIOS(withToken: string) {
105
121
  }
106
122
 
107
123
  if (_isiOS()) {
108
- NativeGroupLinkSDK.startIOS(withToken);
124
+ NativeGroupLinkSDK.startIOS(appLabel);
109
125
  }
110
126
  }
111
127
 
@@ -173,6 +189,29 @@ export function requestFullIntentPermissionAndroid() {
173
189
  }
174
190
  }
175
191
 
192
+ export function setRemoteId(remoteId: string) {
193
+ if (remoteId == null || remoteId === '') {
194
+ _reportError(
195
+ 'setRemoteId(remoteId: string)',
196
+ 'Requires a valid remote id string.'
197
+ );
198
+
199
+ return;
200
+ }
201
+
202
+ if (_isiOS()) {
203
+ NativeGroupLinkSDK.setRemoteIdIOS(remoteId);
204
+ }
205
+
206
+ if(_isAndroid()){
207
+ NativeGroupLinkSDK.setRemoteId(remoteId);
208
+ }
209
+
210
+ }
211
+
212
+ /**
213
+ * @deprecated The method should not be used. use setRemoteId() instead
214
+ */
176
215
  export function setNotificationNameAndroid(name: string) {
177
216
  if (name == null || name === '') {
178
217
  _reportError(
@@ -188,6 +227,9 @@ export function setNotificationNameAndroid(name: string) {
188
227
  }
189
228
  }
190
229
 
230
+ /**
231
+ * @deprecated No longer supported.
232
+ */
191
233
  export async function getNotificationNameAndroid(): Promise<string | null> {
192
234
  if (_isAndroid()) {
193
235
  return NativeGroupLinkSDK.getNotificationNameAndroid();
@@ -196,6 +238,9 @@ export async function getNotificationNameAndroid(): Promise<string | null> {
196
238
  return null;
197
239
  }
198
240
 
241
+ /**
242
+ * @deprecated The method should not be used. use setRemoteId() instead
243
+ */
199
244
  export function setNotificationNameIOS(name: string) {
200
245
  if (name == null || name === '') {
201
246
  _reportError(
@@ -211,6 +256,9 @@ export function setNotificationNameIOS(name: string) {
211
256
  }
212
257
  }
213
258
 
259
+ /**
260
+ * @deprecated No longer supported.
261
+ */
214
262
  export async function getNotificationNameIOS(): Promise<string | null> {
215
263
  if (_isiOS()) {
216
264
  return NativeGroupLinkSDK.getNotificationNameIOS();
@@ -219,6 +267,9 @@ export async function getNotificationNameIOS(): Promise<string | null> {
219
267
  return null;
220
268
  }
221
269
 
270
+ /**
271
+ * @deprecated The method should not be used. use setRemoteId() instead
272
+ */
222
273
  export function setNotificationName(name: string) {
223
274
  if (name == null || name === '') {
224
275
  _reportError(