@grouplinknetwork/rn-grouplink-sdk 1.2.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.
Files changed (31) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +29 -0
  3. package/android/.gradle/7.4.2/checksums/checksums.lock +0 -0
  4. package/android/.gradle/7.4.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.4.2/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/7.4.2/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/7.4.2/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/7.4.2/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/7.4.2/gc.properties +0 -0
  10. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  11. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  12. package/android/.gradle/vcs-1/gc.properties +0 -0
  13. package/android/build.gradle +149 -0
  14. package/android/gradle.properties +5 -0
  15. package/android/libs/lib-grouplink-debug_v3_14_1.aar +0 -0
  16. package/android/libs/lib-grouplink-release_v3_14_1.aar +0 -0
  17. package/android/src/main/AndroidManifest.xml +24 -0
  18. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkModule.java +120 -0
  19. package/android/src/main/java/com/grouplinksdk/GrouplinkSdkPackage.java +28 -0
  20. package/grouplink-sdk.podspec +36 -0
  21. package/ios/GrouplinkSdk-Bridging-Header.h +2 -0
  22. package/ios/GrouplinkSdk.m +16 -0
  23. package/ios/GrouplinkSdk.swift +30 -0
  24. package/ios/GrouplinkSdk.xcodeproj/project.pbxproj +283 -0
  25. package/lib/commonjs/index.js +81 -0
  26. package/lib/commonjs/index.js.map +1 -0
  27. package/lib/module/index.js +64 -0
  28. package/lib/module/index.js.map +1 -0
  29. package/lib/typescript/index.d.ts +5 -0
  30. package/package.json +130 -0
  31. package/src/index.tsx +72 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Vitor Hugo
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # grouplink-sdk
2
+ Group Link SDK for Android and iOS Devices
3
+ ## Installation
4
+
5
+ ```sh
6
+ npm install grouplink-sdk
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```js
12
+ import { multiply } from "grouplink-sdk";
13
+
14
+ // ...
15
+
16
+ const result = await multiply(3, 7);
17
+ ```
18
+
19
+ ## Contributing
20
+
21
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
22
+
23
+ ## License
24
+
25
+ MIT
26
+
27
+ ---
28
+
29
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
File without changes
@@ -0,0 +1,2 @@
1
+ #Tue Aug 16 16:37:35 BRT 2022
2
+ gradle.version=7.4.2
File without changes
@@ -0,0 +1,149 @@
1
+ buildscript {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ mavenLocal()
6
+ maven { url 'https://jitpack.io' }
7
+ }
8
+
9
+ dependencies {
10
+ classpath 'com.android.tools.build:gradle:3.5.3'
11
+ }
12
+ }
13
+
14
+ def isNewArchitectureEnabled() {
15
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
16
+ }
17
+
18
+ apply plugin: 'com.android.library'
19
+
20
+ if (isNewArchitectureEnabled()) {
21
+ apply plugin: 'com.facebook.react'
22
+ }
23
+
24
+ def getExtOrDefault(name) {
25
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['GrouplinkSdk_' + name]
26
+ }
27
+
28
+ def getExtOrIntegerDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['GrouplinkSdk_' + name]).toInteger()
30
+ }
31
+
32
+ android {
33
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
34
+
35
+ defaultConfig {
36
+ minSdkVersion getExtOrIntegerDefault('minSdkVersion')
37
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
38
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
39
+ }
40
+ buildTypes {
41
+ release {
42
+ minifyEnabled false
43
+ }
44
+ }
45
+
46
+ lintOptions {
47
+ disable 'GradleCompatible'
48
+ }
49
+
50
+ compileOptions {
51
+ sourceCompatibility JavaVersion.VERSION_1_8
52
+ targetCompatibility JavaVersion.VERSION_1_8
53
+ }
54
+ }
55
+
56
+ repositories {
57
+ mavenCentral()
58
+ google()
59
+
60
+ def found = false
61
+ def defaultDir = null
62
+ def androidSourcesName = 'React Native sources'
63
+
64
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
65
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
66
+ } else {
67
+ defaultDir = new File(
68
+ projectDir,
69
+ '/../../../node_modules/react-native/android'
70
+ )
71
+ }
72
+
73
+ if (defaultDir.exists()) {
74
+ maven {
75
+ url defaultDir.toString()
76
+ name androidSourcesName
77
+ }
78
+
79
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
80
+ found = true
81
+ } else {
82
+ def parentDir = rootProject.projectDir
83
+
84
+ 1.upto(5, {
85
+ if (found) return true
86
+ parentDir = parentDir.parentFile
87
+
88
+ def androidSourcesDir = new File(
89
+ parentDir,
90
+ 'node_modules/react-native'
91
+ )
92
+
93
+ def androidPrebuiltBinaryDir = new File(
94
+ parentDir,
95
+ 'node_modules/react-native/android'
96
+ )
97
+
98
+ if (androidPrebuiltBinaryDir.exists()) {
99
+ maven {
100
+ url androidPrebuiltBinaryDir.toString()
101
+ name androidSourcesName
102
+ }
103
+
104
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
105
+ found = true
106
+ } else if (androidSourcesDir.exists()) {
107
+ maven {
108
+ url androidSourcesDir.toString()
109
+ name androidSourcesName
110
+ }
111
+
112
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
113
+ found = true
114
+ }
115
+ })
116
+ }
117
+
118
+ if (!found) {
119
+ throw new GradleException(
120
+ "${project.name}: unable to locate React Native android sources. " +
121
+ "Ensure you have you installed React Native as a dependency in your project and try again."
122
+ )
123
+ }
124
+ }
125
+
126
+
127
+ dependencies {
128
+ //noinspection GradleDynamicVersion
129
+ implementation "com.facebook.react:react-native:+"
130
+ implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
131
+ implementation "androidx.annotation:annotation:1.1.0"
132
+ implementation "androidx.core:core:1.8.0"
133
+ implementation 'androidx.appcompat:appcompat:1.4.0'
134
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
135
+ implementation 'androidx.work:work-runtime:2.7.1'
136
+ implementation 'com.google.android.material:material:1.2.1'
137
+ implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
138
+ implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
139
+ implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
140
+ implementation 'com.grouplinknetwork:lib-grouplinknetwork:3.15.12'
141
+ }
142
+
143
+ if (isNewArchitectureEnabled()) {
144
+ react {
145
+ jsRootDir = file("../src/")
146
+ libraryName = "GrouplinkSdk"
147
+ codegenJavaPackageName = "com.grouplinksdk"
148
+ }
149
+ }
@@ -0,0 +1,5 @@
1
+ GrouplinkSdk_kotlinVersion=1.7.0
2
+ GrouplinkSdk_minSdkVersion=21
3
+ GrouplinkSdk_targetSdkVersion=31
4
+ GrouplinkSdk_compileSdkVersion=31
5
+ GrouplinkSdk_ndkversion=21.4.7075529
@@ -0,0 +1,24 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.grouplinksdk">
3
+ <uses-permission
4
+ android:name="android.permission.INTERNET" />
5
+ <uses-permission
6
+ android:name="android.permission.ACCESS_FINE_LOCATION " />
7
+ <uses-permission
8
+ android:name="android.permission.ACCESS_COARSE_LOCATION" />
9
+ <uses-permission
10
+ android:name="android.permission.BLUETOOTH_ADMIN" />
11
+ <uses-permission
12
+ android:name="android.permission.ACCESS_WIFI_STATE" />
13
+ <uses-permission
14
+ android:name="android.permission.FOREGROUND_SERVICE"/>
15
+
16
+ <!-- Mandatory permissions for Android 12 and above.-->
17
+ <!-- Also, they should be asked in runtime. -->
18
+ <uses-permission
19
+ android:name="android.permission.BLUETOOTH_SCAN"
20
+ android:minSdkVersion="31"
21
+ android:usesPermissionFlags="neverForLocation" />
22
+ <uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
23
+ <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
24
+ </manifest>
@@ -0,0 +1,120 @@
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
+
23
+ import com.grouplinknetwork.GroupLink;
24
+
25
+ @ReactModule(name = GrouplinkSdkModule.NAME)
26
+ public class GrouplinkSdkModule extends ReactContextBaseJavaModule implements LifecycleEventListener{
27
+ public static final String NAME = "RNGroupLinkSDK";
28
+ private ReactApplicationContext mReactApplicationContext;
29
+ private ReactContext mReactContext;
30
+ private boolean glInitDone = false;
31
+ private String token = "";
32
+ private boolean debbugable = false;
33
+
34
+ public GrouplinkSdkModule(ReactApplicationContext reactContext) {
35
+ super(reactContext);
36
+ mReactApplicationContext = reactContext;
37
+ mReactContext = reactContext;
38
+ mReactContext.addLifecycleEventListener(this);
39
+ }
40
+
41
+ @Override
42
+ @NonNull
43
+ public String getName() {
44
+ return NAME;
45
+ }
46
+
47
+
48
+ // Example method
49
+ // See https://reactnative.dev/docs/native-modules-android
50
+ @ReactMethod
51
+ public void multiply(double a, double b, Promise promise) {
52
+ promise.resolve(a * b);
53
+ }
54
+
55
+ @ReactMethod
56
+ public void registerAndroid(Context context, String token, boolean debuggable) {
57
+ Handler handler = new Handler(Looper.getMainLooper());
58
+ handler.post(new Runnable() {
59
+ public void run(){
60
+ GroupLink.register(context, token, debuggable);
61
+ }
62
+ });
63
+ }
64
+
65
+ @ReactMethod
66
+ public void startAndroid(String token, boolean debbugable) {
67
+ this.token = token;
68
+ this.debbugable = debbugable;
69
+ initGrouplink();
70
+ }
71
+
72
+ @ReactMethod
73
+ public void setFirebaseToken(String token){
74
+ Context context = mReactApplicationContext.getApplicationContext();
75
+ if(token.equalsIgnoreCase("")){
76
+ Log.e("GL_K01", "not initing");
77
+ return;
78
+ }
79
+ if (context == null) {
80
+ // in some cases, especially when react-native-navigation is installed,
81
+ // the activity can be null, so we can initialize with the context instead
82
+ context = mReactApplicationContext.getApplicationContext();
83
+ }
84
+ try{
85
+ GroupLink.setFirebaseToken(context, token);
86
+ }catch(Exception e){
87
+ e.printStackTrace();
88
+ }
89
+ }
90
+
91
+ private void initGrouplink() {
92
+ Context context = mReactApplicationContext.getApplicationContext();
93
+ if(token.equalsIgnoreCase("")){
94
+ Log.e("GL_K01", "not initing");
95
+ return;
96
+ }
97
+ if (context == null) {
98
+ // in some cases, especially when react-native-navigation is installed,
99
+ // the activity can be null, so we can initialize with the context instead
100
+ context = mReactApplicationContext.getApplicationContext();
101
+ }
102
+ Log.d("AndroidGL", "init android with: " + token);
103
+ registerAndroid(context, token, debbugable);
104
+ }
105
+
106
+ @Override
107
+ public void onHostDestroy() {
108
+
109
+ }
110
+
111
+ @Override
112
+ public void onHostPause() {
113
+
114
+ }
115
+
116
+ @Override
117
+ public void onHostResume() {
118
+ }
119
+
120
+ }
@@ -0,0 +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
+ }
@@ -0,0 +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
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,16 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(RNGroupLinkSDK, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(startIOS:(NSString)withToken)
6
+ RCT_EXTERN_METHOD(startBluetoothIOS)
7
+ RCT_EXTERN_METHOD(checkBluetoothIOS)
8
+ RCT_EXTERN_METHOD(startLocationIOS)
9
+ RCT_EXTERN_METHOD(setDevicePushToken:(NSString)withPushToken)
10
+
11
+ + (BOOL)requiresMainQueueSetup
12
+ {
13
+ return YES;
14
+ }
15
+
16
+ @end
@@ -0,0 +1,30 @@
1
+ import Foundation
2
+ import GroupLink
3
+
4
+ @objc(RNGroupLinkSDK)
5
+ class RNGroupLinkSDK: NSObject {
6
+ @objc(startIOS:)
7
+ func startIOS(withToken: String) -> Void {
8
+ GroupLinkSDK.start(token: withToken)
9
+ }
10
+
11
+ @objc(setDevicePushToken:)
12
+ func setDevicePushToken(withPushToken: String) -> Void {
13
+ GroupLinkSDK.sendNotificationToken(withPushToken)
14
+ }
15
+
16
+ @objc(startBluetoothIOS)
17
+ func startBluetoothIOS() -> Void {
18
+ GroupLinkSDK.startBluetooth()
19
+ }
20
+
21
+ @objc(startLocationIOS)
22
+ func startLocationIOS() -> Void {
23
+ GroupLinkSDK.startLocation()
24
+ }
25
+
26
+ @objc(checkBluetoothIOS)
27
+ func checkBluetoothIOS() -> Void {
28
+ GroupLinkSDK.checkBluetooth()
29
+ }
30
+ }
@@ -0,0 +1,283 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ 5E555C0D2413F4C50049A1A2 /* GrouplinkSdk.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* GrouplinkSdk.m */; };
11
+ F4FF95D7245B92E800C19C63 /* GrouplinkSdk.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* GrouplinkSdk.swift */; };
12
+ /* End PBXBuildFile section */
13
+
14
+ /* Begin PBXCopyFilesBuildPhase section */
15
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
16
+ isa = PBXCopyFilesBuildPhase;
17
+ buildActionMask = 2147483647;
18
+ dstPath = "include/$(PRODUCT_NAME)";
19
+ dstSubfolderSpec = 16;
20
+ files = (
21
+ );
22
+ runOnlyForDeploymentPostprocessing = 0;
23
+ };
24
+ /* End PBXCopyFilesBuildPhase section */
25
+
26
+ /* Begin PBXFileReference section */
27
+ 134814201AA4EA6300B7C361 /* libGrouplinkSdk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libGrouplinkSdk.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
+ B3E7B5891CC2AC0600A0062D /* GrouplinkSdk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrouplinkSdk.m; sourceTree = "<group>"; };
29
+ F4FF95D5245B92E700C19C63 /* GrouplinkSdk-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GrouplinkSdk-Bridging-Header.h"; sourceTree = "<group>"; };
30
+ F4FF95D6245B92E800C19C63 /* GrouplinkSdk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrouplinkSdk.swift; sourceTree = "<group>"; };
31
+ /* End PBXFileReference section */
32
+
33
+ /* Begin PBXFrameworksBuildPhase section */
34
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
35
+ isa = PBXFrameworksBuildPhase;
36
+ buildActionMask = 2147483647;
37
+ files = (
38
+ );
39
+ runOnlyForDeploymentPostprocessing = 0;
40
+ };
41
+ /* End PBXFrameworksBuildPhase section */
42
+
43
+ /* Begin PBXGroup section */
44
+ 134814211AA4EA7D00B7C361 /* Products */ = {
45
+ isa = PBXGroup;
46
+ children = (
47
+ 134814201AA4EA6300B7C361 /* libGrouplinkSdk.a */,
48
+ );
49
+ name = Products;
50
+ sourceTree = "<group>";
51
+ };
52
+ 58B511D21A9E6C8500147676 = {
53
+ isa = PBXGroup;
54
+ children = (
55
+ F4FF95D6245B92E800C19C63 /* GrouplinkSdk.swift */,
56
+ B3E7B5891CC2AC0600A0062D /* GrouplinkSdk.m */,
57
+ F4FF95D5245B92E700C19C63 /* GrouplinkSdk-Bridging-Header.h */,
58
+ 134814211AA4EA7D00B7C361 /* Products */,
59
+ );
60
+ sourceTree = "<group>";
61
+ };
62
+ /* End PBXGroup section */
63
+
64
+ /* Begin PBXNativeTarget section */
65
+ 58B511DA1A9E6C8500147676 /* GrouplinkSdk */ = {
66
+ isa = PBXNativeTarget;
67
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "GrouplinkSdk" */;
68
+ buildPhases = (
69
+ 58B511D71A9E6C8500147676 /* Sources */,
70
+ 58B511D81A9E6C8500147676 /* Frameworks */,
71
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
72
+ );
73
+ buildRules = (
74
+ );
75
+ dependencies = (
76
+ );
77
+ name = GrouplinkSdk;
78
+ productName = RCTDataManager;
79
+ productReference = 134814201AA4EA6300B7C361 /* libGrouplinkSdk.a */;
80
+ productType = "com.apple.product-type.library.static";
81
+ };
82
+ /* End PBXNativeTarget section */
83
+
84
+ /* Begin PBXProject section */
85
+ 58B511D31A9E6C8500147676 /* Project object */ = {
86
+ isa = PBXProject;
87
+ attributes = {
88
+ LastUpgradeCheck = 0920;
89
+ ORGANIZATIONNAME = Facebook;
90
+ TargetAttributes = {
91
+ 58B511DA1A9E6C8500147676 = {
92
+ CreatedOnToolsVersion = 6.1.1;
93
+ };
94
+ };
95
+ };
96
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "GrouplinkSdk" */;
97
+ compatibilityVersion = "Xcode 3.2";
98
+ developmentRegion = English;
99
+ hasScannedForEncodings = 0;
100
+ knownRegions = (
101
+ English,
102
+ en,
103
+ );
104
+ mainGroup = 58B511D21A9E6C8500147676;
105
+ productRefGroup = 58B511D21A9E6C8500147676;
106
+ projectDirPath = "";
107
+ projectRoot = "";
108
+ targets = (
109
+ 58B511DA1A9E6C8500147676 /* GrouplinkSdk */,
110
+ );
111
+ };
112
+ /* End PBXProject section */
113
+
114
+ /* Begin PBXSourcesBuildPhase section */
115
+ 58B511D71A9E6C8500147676 /* Sources */ = {
116
+ isa = PBXSourcesBuildPhase;
117
+ buildActionMask = 2147483647;
118
+ files = (
119
+ F4FF95D7245B92E800C19C63 /* GrouplinkSdk.swift in Sources */,
120
+ B3E7B58A1CC2AC0600A0062D /* GrouplinkSdk.m in Sources */,
121
+ );
122
+ runOnlyForDeploymentPostprocessing = 0;
123
+ };
124
+ /* End PBXSourcesBuildPhase section */
125
+
126
+ /* Begin XCBuildConfiguration section */
127
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
128
+ isa = XCBuildConfiguration;
129
+ buildSettings = {
130
+ ALWAYS_SEARCH_USER_PATHS = NO;
131
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
132
+ CLANG_CXX_LIBRARY = "libc++";
133
+ CLANG_ENABLE_MODULES = YES;
134
+ CLANG_ENABLE_OBJC_ARC = YES;
135
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
136
+ CLANG_WARN_BOOL_CONVERSION = YES;
137
+ CLANG_WARN_COMMA = YES;
138
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
139
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
140
+ CLANG_WARN_EMPTY_BODY = YES;
141
+ CLANG_WARN_ENUM_CONVERSION = YES;
142
+ CLANG_WARN_INFINITE_RECURSION = YES;
143
+ CLANG_WARN_INT_CONVERSION = YES;
144
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
145
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
146
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
147
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
148
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
149
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
150
+ CLANG_WARN_UNREACHABLE_CODE = YES;
151
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
152
+ COPY_PHASE_STRIP = NO;
153
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
154
+ ENABLE_TESTABILITY = YES;
155
+ "EXCLUDED_ARCHS[sdk=*]" = arm64;
156
+ GCC_C_LANGUAGE_STANDARD = gnu99;
157
+ GCC_DYNAMIC_NO_PIC = NO;
158
+ GCC_NO_COMMON_BLOCKS = YES;
159
+ GCC_OPTIMIZATION_LEVEL = 0;
160
+ GCC_PREPROCESSOR_DEFINITIONS = (
161
+ "DEBUG=1",
162
+ "$(inherited)",
163
+ );
164
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
165
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
166
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
167
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
168
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
169
+ GCC_WARN_UNUSED_FUNCTION = YES;
170
+ GCC_WARN_UNUSED_VARIABLE = YES;
171
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
172
+ MTL_ENABLE_DEBUG_INFO = YES;
173
+ ONLY_ACTIVE_ARCH = YES;
174
+ SDKROOT = iphoneos;
175
+ };
176
+ name = Debug;
177
+ };
178
+ 58B511EE1A9E6C8500147676 /* Release */ = {
179
+ isa = XCBuildConfiguration;
180
+ buildSettings = {
181
+ ALWAYS_SEARCH_USER_PATHS = NO;
182
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
183
+ CLANG_CXX_LIBRARY = "libc++";
184
+ CLANG_ENABLE_MODULES = YES;
185
+ CLANG_ENABLE_OBJC_ARC = YES;
186
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
187
+ CLANG_WARN_BOOL_CONVERSION = YES;
188
+ CLANG_WARN_COMMA = YES;
189
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
190
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
191
+ CLANG_WARN_EMPTY_BODY = YES;
192
+ CLANG_WARN_ENUM_CONVERSION = YES;
193
+ CLANG_WARN_INFINITE_RECURSION = YES;
194
+ CLANG_WARN_INT_CONVERSION = YES;
195
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
196
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
197
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
198
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
199
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
200
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
201
+ CLANG_WARN_UNREACHABLE_CODE = YES;
202
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
203
+ COPY_PHASE_STRIP = YES;
204
+ ENABLE_NS_ASSERTIONS = NO;
205
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
206
+ "EXCLUDED_ARCHS[sdk=*]" = arm64;
207
+ GCC_C_LANGUAGE_STANDARD = gnu99;
208
+ GCC_NO_COMMON_BLOCKS = YES;
209
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
210
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
211
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
212
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
213
+ GCC_WARN_UNUSED_FUNCTION = YES;
214
+ GCC_WARN_UNUSED_VARIABLE = YES;
215
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
216
+ MTL_ENABLE_DEBUG_INFO = NO;
217
+ SDKROOT = iphoneos;
218
+ VALIDATE_PRODUCT = YES;
219
+ };
220
+ name = Release;
221
+ };
222
+ 58B511F01A9E6C8500147676 /* Debug */ = {
223
+ isa = XCBuildConfiguration;
224
+ buildSettings = {
225
+ HEADER_SEARCH_PATHS = (
226
+ "$(inherited)",
227
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
228
+ "$(SRCROOT)/../../../React/**",
229
+ "$(SRCROOT)/../../react-native/React/**",
230
+ );
231
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
232
+ OTHER_LDFLAGS = "-ObjC";
233
+ PRODUCT_NAME = GrouplinkSdk;
234
+ SKIP_INSTALL = YES;
235
+ SWIFT_OBJC_BRIDGING_HEADER = "GrouplinkSdk-Bridging-Header.h";
236
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
237
+ SWIFT_VERSION = 5.0;
238
+ };
239
+ name = Debug;
240
+ };
241
+ 58B511F11A9E6C8500147676 /* Release */ = {
242
+ isa = XCBuildConfiguration;
243
+ buildSettings = {
244
+ HEADER_SEARCH_PATHS = (
245
+ "$(inherited)",
246
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
247
+ "$(SRCROOT)/../../../React/**",
248
+ "$(SRCROOT)/../../react-native/React/**",
249
+ );
250
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
251
+ OTHER_LDFLAGS = "-ObjC";
252
+ PRODUCT_NAME = GrouplinkSdk;
253
+ SKIP_INSTALL = YES;
254
+ SWIFT_OBJC_BRIDGING_HEADER = "GrouplinkSdk-Bridging-Header.h";
255
+ SWIFT_VERSION = 5.0;
256
+ };
257
+ name = Release;
258
+ };
259
+ /* End XCBuildConfiguration section */
260
+
261
+ /* Begin XCConfigurationList section */
262
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "GrouplinkSdk" */ = {
263
+ isa = XCConfigurationList;
264
+ buildConfigurations = (
265
+ 58B511ED1A9E6C8500147676 /* Debug */,
266
+ 58B511EE1A9E6C8500147676 /* Release */,
267
+ );
268
+ defaultConfigurationIsVisible = 0;
269
+ defaultConfigurationName = Release;
270
+ };
271
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "GrouplinkSdk" */ = {
272
+ isa = XCConfigurationList;
273
+ buildConfigurations = (
274
+ 58B511F01A9E6C8500147676 /* Debug */,
275
+ 58B511F11A9E6C8500147676 /* Release */,
276
+ );
277
+ defaultConfigurationIsVisible = 0;
278
+ defaultConfigurationName = Release;
279
+ };
280
+ /* End XCConfigurationList section */
281
+ };
282
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
283
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setDevicePushTokenIOS = setDevicePushTokenIOS;
7
+ exports.setFirebaseToken = setFirebaseToken;
8
+ exports.startBluetoothIOS = startBluetoothIOS;
9
+ exports.startGrouplink = startGrouplink;
10
+ exports.startLocationIOS = startLocationIOS;
11
+
12
+ var _reactNative = require("react-native");
13
+
14
+ const LINKING_ERROR = `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
15
+ ios: "- You have run 'pod install'\n",
16
+ default: ''
17
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
18
+ const RNGroupLinkSDK = _reactNative.NativeModules.RNGroupLinkSDK ? _reactNative.NativeModules.RNGroupLinkSDK : new Proxy({}, {
19
+ get() {
20
+ throw new Error(LINKING_ERROR);
21
+ }
22
+
23
+ });
24
+
25
+ function startGrouplink(token, debbugable) {
26
+ if (isAndroid()) {
27
+ startAndroid(token, debbugable);
28
+ }
29
+
30
+ if (isiOS()) {
31
+ startIOS(token);
32
+ }
33
+ }
34
+
35
+ function setFirebaseToken(token) {
36
+ if (isAndroid()) {
37
+ console.log("Android: setting firebase token");
38
+ RNGroupLinkSDK.setFirebaseToken(token);
39
+ }
40
+ }
41
+
42
+ function startBluetoothIOS() {
43
+ if (isiOS()) {
44
+ console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
45
+ return RNGroupLinkSDK.startBluetoothIOS();
46
+ }
47
+
48
+ return;
49
+ }
50
+
51
+ function setDevicePushTokenIOS(token) {
52
+ return RNGroupLinkSDK.setDevicePushToken(token);
53
+ }
54
+
55
+ function startLocationIOS() {
56
+ if (isiOS()) {
57
+ console.log('Group Link SDK (iOS) - Start Location Stack');
58
+ return RNGroupLinkSDK.startLocationIOS();
59
+ }
60
+
61
+ return;
62
+ }
63
+
64
+ function isAndroid() {
65
+ return _reactNative.Platform.OS == 'android';
66
+ }
67
+
68
+ function isiOS() {
69
+ return _reactNative.Platform.OS == 'ios';
70
+ }
71
+
72
+ function startAndroid(withToken, debbugable) {
73
+ console.log('Group Link SDK (Android) - Start with token: ', withToken);
74
+ return RNGroupLinkSDK.startAndroid(withToken, debbugable);
75
+ }
76
+
77
+ function startIOS(withToken) {
78
+ console.log('Group Link SDK (iOS) - Start with token: ', withToken);
79
+ return RNGroupLinkSDK.startIOS(withToken);
80
+ }
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","RNGroupLinkSDK","NativeModules","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;;AAEA,MAAMA,aAAa,GAChB,wEAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,cAAc,GAAGC,0BAAA,CAAcD,cAAd,GACnBC,0BAAA,CAAcD,cADK,GAEnB,IAAIE,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;;AAWO,SAASU,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;;AAEM,SAASM,gBAAT,CAA0BN,KAA1B,EAAwC;EAC7C,IAAGE,SAAS,EAAZ,EAAe;IACbK,OAAO,CAACC,GAAR,CAAY,iCAAZ;IACAd,cAAc,CAACY,gBAAf,CAAgCN,KAAhC;EACD;AACF;;AAEM,SAASS,iBAAT,GAA6B;EAClC,IAAIL,KAAK,EAAT,EAAa;IACXG,OAAO,CAACC,GAAR,CAAY,8CAAZ;IACA,OAAOd,cAAc,CAACe,iBAAf,EAAP;EACD;;EACD;AACD;;AAEM,SAASC,qBAAT,CAA+BV,KAA/B,EAA8C;EACnD,OAAON,cAAc,CAACiB,kBAAf,CAAkCX,KAAlC,CAAP;AACD;;AAEM,SAASY,gBAAT,GAA4B;EACjC,IAAIR,KAAK,EAAT,EAAa;IACXG,OAAO,CAACC,GAAR,CAAY,6CAAZ;IACA,OAAOd,cAAc,CAACkB,gBAAf,EAAP;EACD;;EACD;AACD;;AAED,SAASV,SAAT,GAAqB;EACnB,OAAOZ,qBAAA,CAASuB,EAAT,IAAe,SAAtB;AACD;;AAED,SAAST,KAAT,GAAiB;EACf,OAAOd,qBAAA,CAASuB,EAAT,IAAe,KAAtB;AACD;;AAED,SAASV,YAAT,CAAsBW,SAAtB,EAAyCb,UAAzC,EAA8D;EAC5DM,OAAO,CAACC,GAAR,CAAY,+CAAZ,EAA6DM,SAA7D;EACA,OAAOpB,cAAc,CAACS,YAAf,CAA4BW,SAA5B,EAAuCb,UAAvC,CAAP;AACD;;AAED,SAASI,QAAT,CAAkBS,SAAlB,EAAqC;EACnCP,OAAO,CAACC,GAAR,CAAY,2CAAZ,EAAyDM,SAAzD;EACA,OAAOpB,cAAc,CAACW,QAAf,CAAwBS,SAAxB,CAAP;AACD"}
@@ -0,0 +1,64 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ const LINKING_ERROR = `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
+ ios: "- You have run 'pod install'\n",
4
+ default: ''
5
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
6
+ const RNGroupLinkSDK = NativeModules.RNGroupLinkSDK ? NativeModules.RNGroupLinkSDK : new Proxy({}, {
7
+ get() {
8
+ throw new Error(LINKING_ERROR);
9
+ }
10
+
11
+ });
12
+ export function startGrouplink(token, debbugable) {
13
+ if (isAndroid()) {
14
+ startAndroid(token, debbugable);
15
+ }
16
+
17
+ if (isiOS()) {
18
+ startIOS(token);
19
+ }
20
+ }
21
+ export function setFirebaseToken(token) {
22
+ if (isAndroid()) {
23
+ console.log("Android: setting firebase token");
24
+ RNGroupLinkSDK.setFirebaseToken(token);
25
+ }
26
+ }
27
+ export function startBluetoothIOS() {
28
+ if (isiOS()) {
29
+ console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
30
+ return RNGroupLinkSDK.startBluetoothIOS();
31
+ }
32
+
33
+ return;
34
+ }
35
+ export function setDevicePushTokenIOS(token) {
36
+ return RNGroupLinkSDK.setDevicePushToken(token);
37
+ }
38
+ export function startLocationIOS() {
39
+ if (isiOS()) {
40
+ console.log('Group Link SDK (iOS) - Start Location Stack');
41
+ return RNGroupLinkSDK.startLocationIOS();
42
+ }
43
+
44
+ return;
45
+ }
46
+
47
+ function isAndroid() {
48
+ return Platform.OS == 'android';
49
+ }
50
+
51
+ function isiOS() {
52
+ return Platform.OS == 'ios';
53
+ }
54
+
55
+ function startAndroid(withToken, debbugable) {
56
+ console.log('Group Link SDK (Android) - Start with token: ', withToken);
57
+ return RNGroupLinkSDK.startAndroid(withToken, debbugable);
58
+ }
59
+
60
+ function startIOS(withToken) {
61
+ console.log('Group Link SDK (iOS) - Start with token: ', withToken);
62
+ return RNGroupLinkSDK.startIOS(withToken);
63
+ }
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,CAA0BN,KAA1B,EAAwC;EAC7C,IAAGE,SAAS,EAAZ,EAAe;IACbK,OAAO,CAACC,GAAR,CAAY,iCAAZ;IACAb,cAAc,CAACW,gBAAf,CAAgCN,KAAhC;EACD;AACF;AAED,OAAO,SAASS,iBAAT,GAA6B;EAClC,IAAIL,KAAK,EAAT,EAAa;IACXG,OAAO,CAACC,GAAR,CAAY,8CAAZ;IACA,OAAOb,cAAc,CAACc,iBAAf,EAAP;EACD;;EACD;AACD;AAED,OAAO,SAASC,qBAAT,CAA+BV,KAA/B,EAA8C;EACnD,OAAOL,cAAc,CAACgB,kBAAf,CAAkCX,KAAlC,CAAP;AACD;AAED,OAAO,SAASY,gBAAT,GAA4B;EACjC,IAAIR,KAAK,EAAT,EAAa;IACXG,OAAO,CAACC,GAAR,CAAY,6CAAZ;IACA,OAAOb,cAAc,CAACiB,gBAAf,EAAP;EACD;;EACD;AACD;;AAED,SAASV,SAAT,GAAqB;EACnB,OAAOZ,QAAQ,CAACuB,EAAT,IAAe,SAAtB;AACD;;AAED,SAAST,KAAT,GAAiB;EACf,OAAOd,QAAQ,CAACuB,EAAT,IAAe,KAAtB;AACD;;AAED,SAASV,YAAT,CAAsBW,SAAtB,EAAyCb,UAAzC,EAA8D;EAC5DM,OAAO,CAACC,GAAR,CAAY,+CAAZ,EAA6DM,SAA7D;EACA,OAAOnB,cAAc,CAACQ,YAAf,CAA4BW,SAA5B,EAAuCb,UAAvC,CAAP;AACD;;AAED,SAASI,QAAT,CAAkBS,SAAlB,EAAqC;EACnCP,OAAO,CAACC,GAAR,CAAY,2CAAZ,EAAyDM,SAAzD;EACA,OAAOnB,cAAc,CAACU,QAAf,CAAwBS,SAAxB,CAAP;AACD"}
@@ -0,0 +1,5 @@
1
+ export declare function startGrouplink(token: string, debbugable: boolean): void;
2
+ export declare function setFirebaseToken(token: string): void;
3
+ export declare function startBluetoothIOS(): any;
4
+ export declare function setDevicePushTokenIOS(token: string): any;
5
+ export declare function startLocationIOS(): any;
package/package.json ADDED
@@ -0,0 +1,130 @@
1
+ {
2
+ "name": "@grouplinknetwork/rn-grouplink-sdk",
3
+ "version": "1.2.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
+ "devDependencies": {
49
+ "@arkweid/lefthook": "^0.7.7",
50
+ "@babel/eslint-parser": "^7.18.2",
51
+ "@commitlint/config-conventional": "^17.0.2",
52
+ "@react-native-community/eslint-config": "^3.0.2",
53
+ "@release-it/conventional-changelog": "^5.0.0",
54
+ "@types/jest": "^28.1.2",
55
+ "@types/react": "~17.0.21",
56
+ "@types/react-native": "0.68.0",
57
+ "babel-eslint": "^10.1.0",
58
+ "commitlint": "^17.0.2",
59
+ "eslint": "^8.4.1",
60
+ "eslint-config-prettier": "^8.5.0",
61
+ "eslint-plugin-prettier": "^4.0.0",
62
+ "jest": "^28.1.1",
63
+ "pod-install": "^0.1.0",
64
+ "prettier": "^2.0.5",
65
+ "react": "17.0.2",
66
+ "react-native": "0.68.2",
67
+ "react-native-builder-bob": "^0.18.3",
68
+ "release-it": "^15.3.0",
69
+ "typescript": "^4.7.4"
70
+ },
71
+ "resolutions": {
72
+ "@types/react": "17.0.21"
73
+ },
74
+ "peerDependencies": {
75
+ "react": "*",
76
+ "react-native": "*"
77
+ },
78
+ "jest": {
79
+ "preset": "react-native",
80
+ "modulePathIgnorePatterns": [
81
+ "<rootDir>/example/node_modules",
82
+ "<rootDir>/lib/"
83
+ ]
84
+ },
85
+ "eslintConfig": {
86
+ "root": true,
87
+ "parser": "@babel/eslint-parser",
88
+ "extends": [
89
+ "@react-native-community",
90
+ "prettier"
91
+ ],
92
+ "rules": {
93
+ "prettier/prettier": [
94
+ "error",
95
+ {
96
+ "quoteProps": "consistent",
97
+ "singleQuote": true,
98
+ "tabWidth": 2,
99
+ "trailingComma": "es5",
100
+ "useTabs": false
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ "eslintIgnore": [
106
+ "node_modules/",
107
+ "lib/"
108
+ ],
109
+ "prettier": {
110
+ "quoteProps": "consistent",
111
+ "singleQuote": true,
112
+ "tabWidth": 2,
113
+ "trailingComma": "es5",
114
+ "useTabs": false
115
+ },
116
+ "react-native-builder-bob": {
117
+ "source": "src",
118
+ "output": "lib",
119
+ "targets": [
120
+ "commonjs",
121
+ "module",
122
+ [
123
+ "typescript",
124
+ {
125
+ "project": "tsconfig.build.json"
126
+ }
127
+ ]
128
+ ]
129
+ }
130
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,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 setFirebaseToken(token: string){
30
+ if(isAndroid()){
31
+ console.log("Android: setting firebase token")
32
+ RNGroupLinkSDK.setFirebaseToken(token);
33
+ }
34
+ }
35
+
36
+ export function startBluetoothIOS() {
37
+ if (isiOS()) {
38
+ console.log('Group Link SDK (iOS) - Start Bluetooth Stack');
39
+ return RNGroupLinkSDK.startBluetoothIOS();
40
+ }
41
+ return;
42
+ }
43
+
44
+ export function setDevicePushTokenIOS(token: string) {
45
+ return RNGroupLinkSDK.setDevicePushToken(token)
46
+ }
47
+
48
+ export function startLocationIOS() {
49
+ if (isiOS()) {
50
+ console.log('Group Link SDK (iOS) - Start Location Stack');
51
+ return RNGroupLinkSDK.startLocationIOS();
52
+ }
53
+ return;
54
+ }
55
+
56
+ function isAndroid() {
57
+ return Platform.OS == 'android';
58
+ }
59
+
60
+ function isiOS() {
61
+ return Platform.OS == 'ios';
62
+ }
63
+
64
+ function startAndroid(withToken: string, debbugable: boolean) {
65
+ console.log('Group Link SDK (Android) - Start with token: ', withToken);
66
+ return RNGroupLinkSDK.startAndroid(withToken, debbugable);
67
+ }
68
+
69
+ function startIOS(withToken: string) {
70
+ console.log('Group Link SDK (iOS) - Start with token: ', withToken);
71
+ return RNGroupLinkSDK.startIOS(withToken);
72
+ }