@grouplinknetwork/rn-grouplink-sdk 2.3.4 → 2.3.7
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 +10 -7
- package/android/build.gradle +140 -140
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -5
- package/android/gradle.properties +5 -5
- package/android/gradlew +234 -234
- package/android/src/main/AndroidManifest.xml +24 -24
- package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +133 -133
- 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 +18 -17
- package/ios/GrouplinkSdk.swift +39 -34
- package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -283
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/GrouplinkSdk.xcodeproj/project.xcworkspace/xcuserdata/alessandrodearaujo.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/GrouplinkSdk.xcodeproj/xcuserdata/alessandrodearaujo.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/index.js +13 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +12 -5
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +131 -131
- package/src/index.tsx +99 -92
- 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/config.properties +0 -2
- 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 -19
- package/android/.idea/jarRepositories.xml +0 -30
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
|
@@ -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
|
-
|
|
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
|
+
|
|
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); //initGrouplink()
|
|
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
|
+
}
|
package/grouplink-sdk.podspec
CHANGED
|
@@ -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>
|
package/ios/GrouplinkSdk.m
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
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(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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(startIOS:(NSString)withToken)
|
|
9
|
+
RCT_EXTERN_METHOD(getUserID:
|
|
10
|
+
(RCTPromiseResolveBlock)resolve
|
|
11
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
12
|
+
|
|
13
|
+
+ (BOOL)requiresMainQueueSetup
|
|
14
|
+
{
|
|
15
|
+
return YES;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@end
|
package/ios/GrouplinkSdk.swift
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
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(
|
|
13
|
-
func
|
|
14
|
-
GroupLinkSDK.
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@objc(
|
|
18
|
-
func
|
|
19
|
-
GroupLinkSDK.
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@objc(
|
|
23
|
-
func
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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(startIOS:)
|
|
13
|
+
func startIOS(withToken: String) -> Void {
|
|
14
|
+
GroupLinkSDK.start(withToken:withToken)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@objc(startBluetoothIOS)
|
|
18
|
+
func startBluetoothIOS() -> Void {
|
|
19
|
+
GroupLinkSDK.startBluetooth()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@objc(startLocationIOS)
|
|
23
|
+
func startLocationIOS() -> Void {
|
|
24
|
+
GroupLinkSDK.startLocation()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@objc(getUserID:rejecter:)
|
|
28
|
+
func getUserID(_ resolve: RCTPromiseResolveBlock, rejecter reject:RCTPromiseRejectBlock) -> Void {
|
|
29
|
+
if GroupLinkSDK.getUserID() != nil {
|
|
30
|
+
reject("NO_USER_ID", "Could not get userID at this moment", SDK_ERROR.NO_USER_ID)
|
|
31
|
+
} else {
|
|
32
|
+
resolve(GroupLinkSDK.getUserID())
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
enum SDK_ERROR: Error {
|
|
38
|
+
case NO_USER_ID
|
|
39
|
+
}
|