@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
@@ -1,133 +1,133 @@
1
- package com.grouplinksdk;
2
-
3
- import androidx.annotation.NonNull;
4
- import android.content.Context;
5
- import android.content.pm.ApplicationInfo;
6
- import android.os.Bundle;
7
- import android.util.Log;
8
-
9
- import com.facebook.react.bridge.Callback;
10
- import com.facebook.react.bridge.LifecycleEventListener;
11
- import com.facebook.react.bridge.Promise;
12
- import com.facebook.react.bridge.ReactApplicationContext;
13
- import com.facebook.react.bridge.ReactContext;
14
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
15
- import com.facebook.react.bridge.ReactMethod;
16
- import com.facebook.react.bridge.ReadableArray;
17
- import com.facebook.react.bridge.ReadableMap;
18
- import com.facebook.react.modules.core.DeviceEventManagerModule;
19
- import com.facebook.react.module.annotations.ReactModule;
20
- import android.os.Handler;
21
- import android.os.Looper;
22
- import com.grouplinknetwork.GrouplinkUserIdListener;
23
-
24
- import com.grouplinknetwork.GroupLink;
25
-
26
- @ReactModule(name = GrouplinkSdkModule.NAME)
27
- public class GrouplinkSdkModule extends ReactContextBaseJavaModule implements LifecycleEventListener{
28
- public static final String NAME = "RNGroupLinkSDK";
29
- private ReactApplicationContext mReactApplicationContext;
30
- private ReactContext mReactContext;
31
- private boolean glInitDone = false;
32
- private String token = "";
33
- private boolean debbugable = false;
34
-
35
- public GrouplinkSdkModule(ReactApplicationContext reactContext) {
36
- super(reactContext);
37
- mReactApplicationContext = reactContext;
38
- mReactContext = reactContext;
39
- mReactContext.addLifecycleEventListener(this);
40
- }
41
-
42
- @Override
43
- @NonNull
44
- public String getName() {
45
- return NAME;
46
- }
47
-
48
- @ReactMethod
49
- public void getUserIdAndroid(Promise promise){
50
- Context context = mReactApplicationContext.getApplicationContext();
51
- String userId = "undefined usrId";
52
- try{
53
- userId = GroupLink.getUserId(context);
54
- promise.resolve(userId);
55
- }catch(Exception e){
56
- e.printStackTrace();
57
- promise.reject("not registered");
58
- }
59
- }
60
-
61
- // Example method
62
- // See https://reactnative.dev/docs/native-modules-android
63
- @ReactMethod
64
- public void multiply(double a, double b, Promise promise) {
65
- promise.resolve(a * b);
66
- }
67
-
68
- @ReactMethod
69
- public void registerAndroid(Context context, String token, boolean debuggable) {
70
- Handler handler = new Handler(Looper.getMainLooper());
71
- handler.post(new Runnable() {
72
- public void run(){
73
- GroupLink.register(context, token, debuggable);
74
- }
75
- });
76
- }
77
-
78
- @ReactMethod
79
- public void startAndroid(String token, boolean debbugable) {
80
- this.token = token;
81
- this.debbugable = debbugable;
82
- initGrouplink();
83
- }
84
-
85
- @ReactMethod
86
- public void setFirebaseToken(String token){
87
- Context context = mReactApplicationContext.getApplicationContext();
88
- if(token.equalsIgnoreCase("")){
89
- Log.e("GL_K01", "not initing");
90
- return;
91
- }
92
- if (context == null) {
93
- // in some cases, especially when react-native-navigation is installed,
94
- // the activity can be null, so we can initialize with the context instead
95
- context = mReactApplicationContext.getApplicationContext();
96
- }
97
- try{
98
- GroupLink.setFirebaseToken(context, token);
99
- }catch(Exception e){
100
- e.printStackTrace();
101
- }
102
- }
103
-
104
- private void initGrouplink() {
105
- Context context = mReactApplicationContext.getApplicationContext();
106
- if(token.equalsIgnoreCase("")){
107
- Log.e("GL_K01", "not initing");
108
- return;
109
- }
110
- if (context == null) {
111
- // in some cases, especially when react-native-navigation is installed,
112
- // the activity can be null, so we can initialize with the context instead
113
- context = mReactApplicationContext.getApplicationContext();
114
- }
115
- Log.d("AndroidGL", "init android with: " + token);
116
- registerAndroid(context, token, debbugable);
117
- }
118
-
119
- @Override
120
- public void onHostDestroy() {
121
-
122
- }
123
-
124
- @Override
125
- public void onHostPause() {
126
-
127
- }
128
-
129
- @Override
130
- public void onHostResume() {
131
- }
132
-
133
- }
1
+ package com.grouplinksdk;
2
+
3
+ import androidx.annotation.NonNull;
4
+ import android.content.Context;
5
+ import android.content.pm.ApplicationInfo;
6
+ import android.os.Bundle;
7
+ import android.util.Log;
8
+
9
+ import com.facebook.react.bridge.Callback;
10
+ import com.facebook.react.bridge.LifecycleEventListener;
11
+ import com.facebook.react.bridge.Promise;
12
+ import com.facebook.react.bridge.ReactApplicationContext;
13
+ import com.facebook.react.bridge.ReactContext;
14
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
15
+ import com.facebook.react.bridge.ReactMethod;
16
+ import com.facebook.react.bridge.ReadableArray;
17
+ import com.facebook.react.bridge.ReadableMap;
18
+ import com.facebook.react.modules.core.DeviceEventManagerModule;
19
+ import com.facebook.react.module.annotations.ReactModule;
20
+ import android.os.Handler;
21
+ import android.os.Looper;
22
+ import com.grouplinknetwork.GrouplinkUserIdListener;
23
+
24
+ import com.grouplinknetwork.GroupLink;
25
+
26
+ @ReactModule(name = GrouplinkSdkModule.NAME)
27
+ public class GrouplinkSdkModule extends ReactContextBaseJavaModule implements LifecycleEventListener{
28
+ public static final String NAME = "RNGroupLinkSDK";
29
+ private ReactApplicationContext mReactApplicationContext;
30
+ private ReactContext mReactContext;
31
+ private boolean glInitDone = false;
32
+ private String token = "";
33
+ private boolean debbugable = false;
34
+
35
+ public GrouplinkSdkModule(ReactApplicationContext reactContext) {
36
+ super(reactContext);
37
+ mReactApplicationContext = reactContext;
38
+ mReactContext = reactContext;
39
+ mReactContext.addLifecycleEventListener(this);
40
+ }
41
+
42
+ @Override
43
+ @NonNull
44
+ public String getName() {
45
+ return NAME;
46
+ }
47
+
48
+ @ReactMethod
49
+ public void getUserIdAndroid(Promise promise){
50
+ Context context = mReactApplicationContext.getApplicationContext();
51
+ String userId = "undefined usrId";
52
+ try{
53
+ userId = GroupLink.getUserId(context);
54
+ promise.resolve(userId);
55
+ }catch(Exception e){
56
+ e.printStackTrace();
57
+ promise.reject("not registered");
58
+ }
59
+ }
60
+
61
+ // Example method
62
+ // See https://reactnative.dev/docs/native-modules-android
63
+ @ReactMethod
64
+ public void multiply(double a, double b, Promise promise) {
65
+ promise.resolve(a * b);
66
+ }
67
+
68
+ @ReactMethod
69
+ public void registerAndroid(Context context, String token, boolean debuggable) {
70
+ Handler handler = new Handler(Looper.getMainLooper());
71
+ handler.post(new Runnable() {
72
+ public void run(){
73
+ GroupLink.register(context, token, debuggable);
74
+ }
75
+ });
76
+ }
77
+
78
+ @ReactMethod
79
+ public void startAndroid(String token, boolean debbugable) {
80
+ this.token = token;
81
+ this.debbugable = debbugable;
82
+ initGrouplink();
83
+ }
84
+
85
+ @ReactMethod
86
+ public void setFirebaseToken(String token){
87
+ Context context = mReactApplicationContext.getApplicationContext();
88
+ if(token.equalsIgnoreCase("")){
89
+ Log.e("GL_K01", "not initing");
90
+ return;
91
+ }
92
+ if (context == null) {
93
+ // in some cases, especially when react-native-navigation is installed,
94
+ // the activity can be null, so we can initialize with the context instead
95
+ context = mReactApplicationContext.getApplicationContext();
96
+ }
97
+ try{
98
+ GroupLink.setFirebaseToken(context, token);
99
+ }catch(Exception e){
100
+ e.printStackTrace();
101
+ }
102
+ }
103
+
104
+ private void initGrouplink() {
105
+ Context context = mReactApplicationContext.getApplicationContext();
106
+ if(token.equalsIgnoreCase("")){
107
+ Log.e("GL_K01", "not initing");
108
+ return;
109
+ }
110
+ if (context == null) {
111
+ // in some cases, especially when react-native-navigation is installed,
112
+ // the activity can be null, so we can initialize with the context instead
113
+ context = mReactApplicationContext.getApplicationContext();
114
+ }
115
+ Log.d("AndroidGL", "init android with: " + token);
116
+ registerAndroid(context, token, debbugable);
117
+ }
118
+
119
+ @Override
120
+ public void onHostDestroy() {
121
+
122
+ }
123
+
124
+ @Override
125
+ public void onHostPause() {
126
+
127
+ }
128
+
129
+ @Override
130
+ public void onHostResume() {
131
+ }
132
+
133
+ }
@@ -1,28 +1,28 @@
1
- package com.grouplinksdk;
2
-
3
- import androidx.annotation.NonNull;
4
-
5
- import com.facebook.react.ReactPackage;
6
- import com.facebook.react.bridge.NativeModule;
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.uimanager.ViewManager;
9
-
10
- import java.util.ArrayList;
11
- import java.util.Collections;
12
- import java.util.List;
13
-
14
- public class GrouplinkSdkPackage implements ReactPackage {
15
- @NonNull
16
- @Override
17
- public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
- List<NativeModule> modules = new ArrayList<>();
19
- modules.add(new GrouplinkSdkModule(reactContext));
20
- return modules;
21
- }
22
-
23
- @NonNull
24
- @Override
25
- public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
27
- }
28
- }
1
+ package com.grouplinksdk;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.ArrayList;
11
+ import java.util.Collections;
12
+ import java.util.List;
13
+
14
+ public class GrouplinkSdkPackage implements ReactPackage {
15
+ @NonNull
16
+ @Override
17
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
+ List<NativeModule> modules = new ArrayList<>();
19
+ modules.add(new GrouplinkSdkModule(reactContext));
20
+ return modules;
21
+ }
22
+
23
+ @NonNull
24
+ @Override
25
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
@@ -1,36 +1,36 @@
1
- require "json"
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
- folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
-
6
- Pod::Spec.new do |s|
7
- s.name = "grouplink-sdk"
8
- s.version = package["version"]
9
- s.summary = package["description"]
10
- s.homepage = package["homepage"]
11
- s.license = package["license"]
12
- s.authors = package["author"]
13
-
14
- s.platforms = { :ios => "10.0" }
15
- s.source = { :git => "https://github.com/amazingvitor/grouplink-sdk.git", :tag => "#{s.version}" }
16
-
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
18
-
19
- s.dependency "React-Core"
20
- s.dependency "GroupLinkSDK"
21
-
22
- # Don't install the dependencies when we run `pod install` in the old architecture.
23
- if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
24
- s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
25
- s.pod_target_xcconfig = {
26
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
27
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
28
- }
29
-
30
- s.dependency "React-Codegen"
31
- s.dependency "RCT-Folly"
32
- s.dependency "RCTRequired"
33
- s.dependency "RCTTypeSafety"
34
- s.dependency "ReactCommon/turbomodule/core"
35
- end
36
- end
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = "grouplink-sdk"
8
+ s.version = package["version"]
9
+ s.summary = package["description"]
10
+ s.homepage = package["homepage"]
11
+ s.license = package["license"]
12
+ s.authors = package["author"]
13
+
14
+ s.platforms = { :ios => "10.0" }
15
+ s.source = { :git => "https://github.com/amazingvitor/grouplink-sdk.git", :tag => "#{s.version}" }
16
+
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+
19
+ s.dependency "React-Core"
20
+ s.dependency "GroupLinkSDK"
21
+
22
+ # Don't install the dependencies when we run `pod install` in the old architecture.
23
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
24
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
25
+ s.pod_target_xcconfig = {
26
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
27
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
28
+ }
29
+
30
+ s.dependency "React-Codegen"
31
+ s.dependency "RCT-Folly"
32
+ s.dependency "RCTRequired"
33
+ s.dependency "RCTTypeSafety"
34
+ s.dependency "ReactCommon/turbomodule/core"
35
+ end
36
+ end
@@ -1,2 +1,2 @@
1
- #import <React/RCTBridgeModule.h>
1
+ #import <React/RCTBridgeModule.h>
2
2
  #import <React/RCTViewManager.h>
@@ -1,17 +1,17 @@
1
- #import <React/RCTBridgeModule.h>
2
-
3
- @interface RCT_EXTERN_MODULE(RNGroupLinkSDK, NSObject)
4
-
5
- RCT_EXTERN_METHOD(startBluetoothIOS)
6
- RCT_EXTERN_METHOD(startLocationIOS)
7
- RCT_EXTERN_METHOD(setDevicePushToken:(NSString)withPushToken)
8
- RCT_EXTERN_METHOD(getUserID:
9
- (RCTPromiseResolveBlock)resolve
10
- rejecter:(RCTPromiseRejectBlock)reject)
11
-
12
- + (BOOL)requiresMainQueueSetup
13
- {
14
- return YES;
15
- }
16
-
17
- @end
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(RNGroupLinkSDK, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(startBluetoothIOS)
6
+ RCT_EXTERN_METHOD(startLocationIOS)
7
+ RCT_EXTERN_METHOD(setDevicePushToken:(NSString)withPushToken)
8
+ RCT_EXTERN_METHOD(getUserID:
9
+ (RCTPromiseResolveBlock)resolve
10
+ rejecter:(RCTPromiseRejectBlock)reject)
11
+
12
+ + (BOOL)requiresMainQueueSetup
13
+ {
14
+ return YES;
15
+ }
16
+
17
+ @end
@@ -1,34 +1,34 @@
1
- import Foundation
2
- import GroupLink
3
-
4
- @objc(RNGroupLinkSDK)
5
- class RNGroupLinkSDK: NSObject {
6
-
7
- @objc(setDevicePushToken:)
8
- func setDevicePushToken(withPushToken: String) -> Void {
9
- GroupLinkSDK.sendNotificationToken(withPushToken)
10
- }
11
-
12
- @objc(startBluetoothIOS)
13
- func startBluetoothIOS() -> Void {
14
- GroupLinkSDK.startBluetooth()
15
- }
16
-
17
- @objc(startLocationIOS)
18
- func startLocationIOS() -> Void {
19
- GroupLinkSDK.startLocation()
20
- }
21
-
22
- @objc(getUserID:rejecter:)
23
- func getUserID(_ resolve: RCTPromiseResolveBlock, rejecter reject:RCTPromiseRejectBlock) -> Void {
24
- if GroupLinkSDK.getUserID() != nil {
25
- reject("NO_USER_ID", "Could not get userID at this moment", SDK_ERROR.NO_USER_ID)
26
- } else {
27
- resolve(GroupLinkSDK.getUserID())
28
- }
29
- }
30
- }
31
-
32
- enum SDK_ERROR: Error {
33
- case NO_USER_ID
34
- }
1
+ import Foundation
2
+ import GroupLink
3
+
4
+ @objc(RNGroupLinkSDK)
5
+ class RNGroupLinkSDK: NSObject {
6
+
7
+ @objc(setDevicePushToken:)
8
+ func setDevicePushToken(withPushToken: String) -> Void {
9
+ GroupLinkSDK.sendNotificationToken(withPushToken)
10
+ }
11
+
12
+ @objc(startBluetoothIOS)
13
+ func startBluetoothIOS() -> Void {
14
+ GroupLinkSDK.startBluetooth()
15
+ }
16
+
17
+ @objc(startLocationIOS)
18
+ func startLocationIOS() -> Void {
19
+ GroupLinkSDK.startLocation()
20
+ }
21
+
22
+ @objc(getUserID:rejecter:)
23
+ func getUserID(_ resolve: RCTPromiseResolveBlock, rejecter reject:RCTPromiseRejectBlock) -> Void {
24
+ if GroupLinkSDK.getUserID() != nil {
25
+ reject("NO_USER_ID", "Could not get userID at this moment", SDK_ERROR.NO_USER_ID)
26
+ } else {
27
+ resolve(GroupLinkSDK.getUserID())
28
+ }
29
+ }
30
+ }
31
+
32
+ enum SDK_ERROR: Error {
33
+ case NO_USER_ID
34
+ }