@grouplinknetwork/rn-grouplink-sdk 2.3.11 → 2.3.12

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 CHANGED
@@ -1,20 +1,59 @@
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.
1
+ SOFTWARE LICENSE AGREEMENT
2
+ IMPORTANT - READ CAREFULLY BEFORE USING THIS SOFTWARE
3
+ This Software License Agreement (the "Agreement") is a legal agreement between you (either an individual or a single entity, “) and Group Link Operations S.A. ("Licensor") for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("Software").
4
+ By installing, copying, or otherwise using the software, you agree to be bound by the terms of this agreement. If you do not agree to the terms of this agreement, do not install or use the software.
5
+ 1. GRANT OF LICENSE
6
+ Subject to the terms and conditions of this Agreement, Licensor hereby grants you a limited, non-exclusive, non-transferable license to:
7
+ a) Install and use the Software on devices owned, leased, or controlled by you;
8
+ b) Make copies of the Software solely for backup or archival purposes;
9
+ c) Use the Software for the purpose of integrating with your applications as described in the accompanying documentation.
10
+ 2. RESTRICTIONS
11
+ You may NOT:
12
+ a) Modify, adapt, alter, translate, or create derivative works of the Software;
13
+ b) Reverse engineer, decompile, disassemble, or otherwise attempt to derive the source code of the Software, except to the extent that such activity is expressly permitted by applicable law;
14
+ c) Remove, alter, or obscure any proprietary notices on the Software;
15
+ d) Use the Software for any illegal purpose;
16
+ e) Sublicense, rent, lease, loan, or transfer the Software or any rights granted under this Agreement without the prior written consent of Licensor;
17
+ f) Use the Software in any manner that could damage, disable, overburden, or impair the functioning of the Software or interfere with any other party's use and enjoyment of the Software.
18
+ 3. OWNERSHIPThe Software is licensed, not sold. Licensor retains all right, title, and interest in and to the Software and all intellectual property rights therein, including without limitation all patent, copyright, trademark, and trade secret rights. This Agreement does not grant you any rights to trademarks or service marks of Licensor.
19
+ 4. DATA COLLECTION AND PRIVACY
20
+ The Group Link SDK, which enables the structuring of the Group Link Network, is incorporated in your application and it becomes available to its users.
21
+ The Software does not directly access personal data stored on the devices. Instead, it generates a unique identifier that can be easily reset by uninstalling the application. During operation, the Software may collect certain information, including device-specific details and usage data.
22
+ All data collection and processing of personal data that eventually occur will be conducted in accordance with applicable data protection laws, including but not limited to the Lei Geral de Proteção de Dados (LGPD) in Brazil and the General Data Protection Regulation (GDPR) in Europe, as applicable.
23
+ Group Link may share collected data with third parties solely for specific and limited purposes, ensuring that pseudonymization and anonymization techniques are employed whenever possible.
24
+ By using Group Links software, you must guarantee that will comply with all information security policies, rules and guidelines for the protection of personal data, including issues relating to storage, encryption and access controls, in order to protect them against loss, disclosure and unauthorized access, whether accidental or not, and must adopt measures to ensure adequate security against the risks posed by the nature of the data.
25
+ You are responsible for properly informing your end-users (the data subjects) about the data processing conducted by Group Link, as you have direct contact with these users.
26
+ End-users may exercise their data subject rights by contacting Group Link via email at dpo@grouplinkone.com. Additionally, data subjects have the right to object to processing based on legitimate grounds. If a data subject disagrees with Group Link's processing activities, they may opt-out through the following link: https://grouplinkone.com/forget-device.
27
+ You are obliged to comply with all applicable app store guidelines, including, but not limited to Apple App Store and Google Play Store guidelines.
28
+ 5. UPDATES AND UPGRADES
29
+ Licensor may provide you with updates or upgrades to the Software. Any such updates or upgrades shall be governed by this Agreement unless other terms are provided with the updates or upgrades.
30
+ 6. MAINTENANCE AND SUPPORT
31
+ Licensor may provide maintenance and support for the Software but is not obligated to do so unless a separate agreement for maintenance and support has been entered into between you and Licensor.
32
+ 7. TERM AND TERMINATION
33
+ This Agreement is effective until terminated. You may terminate this Agreement at any time by ceasing all use of the Software and destroying all copies of the Software in your possession or control.
34
+ Licensor may terminate this Agreement immediately and without notice if you fail to comply with any term of this Agreement. Upon termination, you must cease all use of the Software and destroy all copies of the Software in your possession or control.
35
+ 8. WARRANTY DISCLAIMER
36
+ The software is provided "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and noninfringement. Licensor does not warrant that the functions contained in the software will meet your requirements or that the operation of the software will be uninterrupted or error-free.
37
+ 9. LIMITATION OF LIABILITY
38
+ In no event shall licensor be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use the software, even if licensor has been advised of the possibility of such damages.
39
+ Licensor's entire liability under any provision of this agreement shall be limited to the amount actually paid by you for the software.
40
+ 10. INDEMNIFICATION
41
+ You agree to indemnify, defend, and hold harmless Licensor, its officers, directors, employees, agents, and affiliates from and against any and all claims, damages, losses, liabilities, costs, and expenses (including reasonable attorneys' fees) arising from or relating to your use of the Software or your breach of this Agreement.
42
+ 11. EXPORT CONTROLS
43
+ You agree to comply with all applicable international and national laws that apply to the Software, including the export regulations of your country of residence and the country from which you access the Software.
44
+ 12. GOVERNING LAW AND JURISDICTION
45
+ This Agreement shall be governed by and construed in accordance with the laws of Brazil, without giving effect to any principles of conflicts of law. Any dispute arising out of or relating to this Agreement shall be subject to the exclusive jurisdiction of the courts of São Paulo, Brazil.
46
+ 13. SEVERABILITY
47
+ If any provision of this Agreement is held to be unenforceable or invalid, such provision shall be changed and interpreted to accomplish the objectives of such provision to the greatest extent possible under applicable law, and the remaining provisions shall continue in full force and effect.
48
+ 14. WAIVER
49
+ The failure of Licensor to enforce any right or provision of this Agreement will not be deemed a waiver of such right or provision.
50
+ 15. ENTIRE AGREEMENT
51
+ This Agreement constitutes the entire agreement between you and Licensor regarding the Software and supersedes all prior and contemporaneous agreements, proposals, or representations, written or oral, concerning the Software.
52
+ 16. AMENDMENTS
53
+ Licensor reserves the right to modify this Agreement at any time by posting the modified agreement on its website. Your continued use of the Software after any such changes constitutes your acceptance of the modified agreement.
54
+ 17. CONTACT INFORMATIONIf you have any questions about this Agreement, please contact Licensor at:
55
+ Group Link Operations S.A.
56
+ R. Gomes de Carvalho, 1.510 - 12º andar Vila Olímpia - São Paulo - SP - Brasil
57
+ Email: legal@grouplinkone.com
58
+ Website: https://grouplinkone.com
59
+ Last updated: March 26, 2025
package/README.md CHANGED
@@ -1,10 +1,92 @@
1
1
  # grouplink-sdk
2
- Group Link SDK for Android and iOS Devices
2
+ This is the Group Link SDK for React Native to use in Android and iOS Devices.
3
+
4
+ ## Instalation
3
5
 
4
6
  ```sh
5
7
  npm install @grouplinknetwork/rn-grouplink-sdk
8
+
9
+ yarn add @grouplinknetwork/rn-grouplink-sdk
6
10
  ```
7
11
 
12
+ ## Usage
13
+ How to use the Group Link SDK for React Native.
14
+
15
+ ### Import ```Group Link SDK```
8
16
  ```sh
9
- yarn add @grouplinknetwork/rn-grouplink-sdk
10
- ```
17
+ import * as GroupLinkSDK from '@grouplinknetwork/rn-grouplink-sdk';
18
+ ```
19
+
20
+ ### startGrouplink
21
+
22
+ ```sh
23
+ export default function App() {
24
+ useEffect(()=>{
25
+ GroupLinkSDK.startGrouplink("GROUP_LINK_TOKEN", isDebuggable);
26
+ },[])
27
+ return (
28
+ <View style={styles.container}>
29
+ <Text>Este é um aplicativo de teste</Text>
30
+ </View>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## Supported methods
36
+ All the following methods are included in the Group Link SDK Plugin:
37
+
38
+
39
+ ### startGrouplink
40
+ Usage: Start the Group Link SDK.
41
+
42
+
43
+ ### startGrouplinkIOS
44
+ Usage: Start the Group Link SDK only in Android.
45
+
46
+
47
+ ### startSDKiOS
48
+ Usage: Start the Group Link SDK only in iOS.
49
+
50
+
51
+ ### startLocation
52
+ Usage: Start the location, and request it in app.
53
+
54
+
55
+ ### startLocationIOS
56
+ Usage: Start the location in iOS, and request it in app.
57
+
58
+
59
+ ### startLocationAndroid
60
+ Usage: Start the location in android, and request it in app.
61
+
62
+
63
+ ### startBluetooth
64
+ Usage: Start the bluetooth, and request it in app.
65
+
66
+
67
+ ### startBluetoothAndroid
68
+ Usage: Start the bluetooth in Android, and request it in app.
69
+
70
+
71
+ ### startBluetoothIOS
72
+ Usage: Start the bluetooth in iOS, and request it in app.
73
+
74
+
75
+ ### setNotificationToken
76
+ Usage: Set notification by a argument required token.
77
+
78
+
79
+ ### requestFullIntentPermissionAndroid
80
+ Usage: Request the full intent permission in settings of android mobile phone.
81
+
82
+
83
+ ### requestScheduleExactAlarmPermissionAndroid
84
+ Usage: Request the schedule exact alarm permission.
85
+
86
+
87
+ ### setNotificationNameAndroid
88
+ Usage: Set a notification name by argument in android.
89
+
90
+
91
+ ### getNotificationNameAndroid
92
+ Usage: Get the notification name used by a android mobile phone.
@@ -5,6 +5,12 @@ import android.content.Context;
5
5
  import android.content.pm.ApplicationInfo;
6
6
  import android.os.Bundle;
7
7
  import android.util.Log;
8
+ import android.net.Uri;
9
+ import android.app.NotificationManager;
10
+ import android.app.AlarmManager;
11
+ import android.content.Intent;
12
+ import android.provider.Settings;
13
+ import android.os.Build;
8
14
 
9
15
  import com.facebook.react.bridge.Callback;
10
16
  import com.facebook.react.bridge.LifecycleEventListener;
@@ -116,6 +122,73 @@ public class GrouplinkSdkModule extends ReactContextBaseJavaModule implements Li
116
122
  registerAndroid(context, token, debbugable); //initGrouplink()
117
123
  }
118
124
 
125
+ @ReactMethod
126
+ public void requestFullIntentPermissionAndroid() {
127
+ try {
128
+ Context context = mReactApplicationContext.getApplicationContext();
129
+ if (context == null) {
130
+ context = mReactApplicationContext.getApplicationContext();
131
+ }
132
+ NotificationManager notificationManager = (NotificationManager) context.getSystemService(ReactApplicationContext.NOTIFICATION_SERVICE);
133
+ if (Build.VERSION.SDK_INT >= 34) {
134
+ if (!notificationManager.canUseFullScreenIntent()) {
135
+ Intent intent = new Intent(Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT);
136
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
137
+ intent.setData(Uri.fromParts("package", context.getPackageName(), null));
138
+ context.startActivity(intent);
139
+ }
140
+ }
141
+ } catch (Exception e) {
142
+ Log.e("FullIntent", "Failed to open settings: " + e.getMessage());
143
+ }
144
+ }
145
+ @ReactMethod
146
+ public void setNotificationName(String notificationName) {
147
+ try{
148
+ Context context = mReactApplicationContext.getApplicationContext();
149
+ if (context == null) {
150
+ context = mReactApplicationContext.getApplicationContext();
151
+ }
152
+ GroupLink.setNotificationName(context, notificationName);
153
+ }catch (Exception e) {
154
+ Log.e("setNotificationName", "Failed to open settings: " + e.getMessage());
155
+ }
156
+
157
+ }
158
+
159
+ @ReactMethod
160
+ public String getNotificationName() {
161
+ try{
162
+ Context context = mReactApplicationContext.getApplicationContext();
163
+ if (context == null) {
164
+ context = mReactApplicationContext.getApplicationContext();
165
+ }
166
+ return GroupLink.getNotificationName(context);
167
+ }catch (Exception e) {
168
+ Log.e("getNotificationName", "Failed to open settings: " + e.getMessage());
169
+ }
170
+ return "Nothing";
171
+ }
172
+ @ReactMethod
173
+ public void requestScheduleExactAlarm(){
174
+ try {
175
+ Context context = mReactApplicationContext.getApplicationContext();
176
+ if (context == null) {
177
+ context = mReactApplicationContext.getApplicationContext();
178
+ }
179
+ AlarmManager alarmManager = (AlarmManager) context.getSystemService(ReactApplicationContext.ALARM_SERVICE);
180
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && !alarmManager.canScheduleExactAlarms()) {
181
+ Intent intent = new Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM);
182
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
183
+ intent.setData(Uri.fromParts("package", context.getPackageName(), null));
184
+ context.startActivity(intent);
185
+ }
186
+ } catch (Exception e) {
187
+ Log.e("requestScheduleExactAlarm", "Failed to open settings: " + e.getMessage());
188
+ }
189
+ }
190
+
191
+
119
192
  @Override
120
193
  public void onHostDestroy() {
121
194
 
@@ -3,14 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.checkBluetooth = checkBluetooth;
6
+ exports.checkBluetoothIOS = checkBluetoothIOS;
7
+ exports.getNotificationNameAndroid = getNotificationNameAndroid;
7
8
  exports.getUserId = getUserId;
9
+ exports.requestFullIntentPermissionAndroid = requestFullIntentPermissionAndroid;
10
+ exports.requestScheduleExactAlarmPermissionAndroid = requestScheduleExactAlarmPermissionAndroid;
8
11
  exports.setDevicePushTokenIOS = setDevicePushTokenIOS;
9
12
  exports.setFirebaseToken = setFirebaseToken;
13
+ exports.setNotificationNameAndroid = setNotificationNameAndroid;
14
+ exports.startBluetoothAndroid = startBluetoothAndroid;
10
15
  exports.startBluetoothIOS = startBluetoothIOS;
11
16
  exports.startGrouplink = startGrouplink;
12
17
  exports.startGrouplinkAndroid = startGrouplinkAndroid;
13
18
  exports.startGrouplinkIOS = startGrouplinkIOS;
19
+ exports.startLocationAndroid = startLocationAndroid;
14
20
  exports.startLocationIOS = startLocationIOS;
15
21
  var _reactNative = require("react-native");
16
22
  const LINKING_ERROR = `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
@@ -96,9 +102,44 @@ function startGrouplinkIOS(withToken) {
96
102
  startIOS(withToken);
97
103
  }
98
104
  }
99
- function checkBluetooth() {
105
+ function checkBluetoothIOS() {
100
106
  if (isiOS()) return RNGroupLinkSDK.checkBluetoothIOS();
101
107
  }
108
+ async function startBluetoothAndroid() {
109
+ if (!(_reactNative.Platform.OS === "android" && _reactNative.Platform.Version >= 31)) return;
110
+ const bluetoothPermission = await _reactNative.PermissionsAndroid.requestMultiple([_reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE, _reactNative.PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT]);
111
+ if (bluetoothPermission["android.permission.BLUETOOTH_SCAN"] === _reactNative.PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission["android.permission.BLUETOOTH_ADVERTISE"] === _reactNative.PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission["android.permission.BLUETOOTH_CONNECT"] === _reactNative.PermissionsAndroid.RESULTS.GRANTED) {}
112
+ }
113
+ ;
114
+ async function startLocationAndroid() {
115
+ if (!(_reactNative.Platform.OS == "android" && _reactNative.Platform.Version >= 23)) return;
116
+ const locationPermission = await _reactNative.PermissionsAndroid.requestMultiple([_reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, _reactNative.PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]);
117
+ if (locationPermission["android.permission.ACCESS_COARSE_LOCATION"] === _reactNative.PermissionsAndroid.RESULTS.GRANTED && locationPermission["android.permission.ACCESS_FINE_LOCATION"] === _reactNative.PermissionsAndroid.RESULTS.GRANTED) {
118
+ console.log("Localização ativa.");
119
+ } else {
120
+ console.log("Permissões de localização negadas");
121
+ }
122
+ }
123
+ function requestFullIntentPermissionAndroid() {
124
+ if (isAndroid()) {
125
+ return RNGroupLinkSDK.requestFullIntentPermissionAndroid();
126
+ }
127
+ }
128
+ function setNotificationNameAndroid(name) {
129
+ if (isAndroid()) {
130
+ return RNGroupLinkSDK.setNotificationName(name);
131
+ }
132
+ }
133
+ function getNotificationNameAndroid() {
134
+ if (isAndroid()) {
135
+ return RNGroupLinkSDK.getNotificationName();
136
+ }
137
+ }
138
+ function requestScheduleExactAlarmPermissionAndroid() {
139
+ if (isAndroid()) {
140
+ return RNGroupLinkSDK.requestScheduleExactAlarm();
141
+ }
142
+ }
102
143
 
103
144
  // function getUserIDiOS(success: (userId: string) => void) {
104
145
  // RNGroupLinkSDK.getUserID(success);
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RNGroupLinkSDK","NativeModules","Proxy","get","Error","getUserId","isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","isiOS","getUserID","setFirebaseToken","token","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","startAndroid","withToken","debbugable","startIOS","startGrouplink","startGrouplinkAndroid","startGrouplinkIOS","checkBluetooth","checkBluetoothIOS"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,wEAAwE,GACxEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc,GAC/CC,0BAAa,CAACD,cAAc,GAC5B,IAAIE,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEI,eAAeU,SAASA,CAAA,EAA2B;EACxD,IAAIC,SAAS,CAAC,CAAC,EAAE;IACf,MAAMC,MAAc,GAAG,MAAMP,cAAc,CAACQ,gBAAgB,CAAC,CAAC;IAC9D,IAAID,MAAM,IAAI,0BAA0B,EAAE;MACxC,OAAOE,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AAI,KAAK;AAC7B;AAEA,SAASC,YAAYA,CAACC,SAAiB,EAAEC,UAAmB,EAAE;EAC5DT,OAAO,CAACC,GAAG,CAAC,+CAA+C,EAAEO,SAAS,CAAC;EACvE,OAAOxB,cAAc,CAACuB,YAAY,CAACC,SAAS,EAAEC,UAAU,CAAC;AAC3D;AACA,SAASC,QAAQA,CAACF,SAAiB,EAAE;EACnCR,OAAO,CAACC,GAAG,CAAC,2CAA2C,EAAEO,SAAS,CAAC;EACnE,OAAOxB,cAAc,CAAC0B,QAAQ,CAACF,SAAS,CAAC;AAC3C;AAEO,SAASG,cAAcA,CAACH,SAAiB,EAAEC,UAAmB,EAAE;EACrE,IAAIb,KAAK,CAAC,CAAC,EAAE;IACXc,QAAQ,CAACF,SAAS,CAAC;EACrB;EACA,IAAIlB,SAAS,CAAC,CAAC,EAAE;IACfiB,YAAY,CAACC,SAAS,EAAEC,UAAU,CAAC;EACrC;AACF;AAEO,SAASG,qBAAqBA,CAACJ,SAAiB,EAAEC,UAAmB,EAAE;EAC5E,IAAInB,SAAS,CAAC,CAAC,EAAE;IACfiB,YAAY,CAACC,SAAS,EAAEC,UAAU,CAAC;EACrC;AACF;AAEO,SAASI,iBAAiBA,CAACL,SAAiB,EAAE;EACnD,IAAIZ,KAAK,CAAC,CAAC,EAAE;IACXc,QAAQ,CAACF,SAAS,CAAC;EACrB;AACF;AAEO,SAASM,cAAcA,CAAA,EAAG;EAC/B,IAAIlB,KAAK,CAAC,CAAC,EACT,OAAOZ,cAAc,CAAC+B,iBAAiB,CAAC,CAAC;AAC7C;;AAEA;AACA;AACA;;AAEA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RNGroupLinkSDK","NativeModules","Proxy","get","Error","getUserId","isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","isiOS","getUserID","setFirebaseToken","token","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","startAndroid","withToken","debbugable","startIOS","startGrouplink","startGrouplinkAndroid","startGrouplinkIOS","checkBluetoothIOS","startBluetoothAndroid","Version","bluetoothPermission","PermissionsAndroid","requestMultiple","PERMISSIONS","BLUETOOTH_SCAN","BLUETOOTH_ADVERTISE","BLUETOOTH_CONNECT","RESULTS","GRANTED","startLocationAndroid","locationPermission","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","requestFullIntentPermissionAndroid","setNotificationNameAndroid","name","setNotificationName","getNotificationNameAndroid","getNotificationName","requestScheduleExactAlarmPermissionAndroid","requestScheduleExactAlarm"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,wEAAwE,GACxEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGC,0BAAa,CAACD,cAAc,GAC/CC,0BAAa,CAACD,cAAc,GAC5B,IAAIE,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEI,eAAeU,SAASA,CAAA,EAA2B;EACxD,IAAIC,SAAS,CAAC,CAAC,EAAE;IACf,MAAMC,MAAc,GAAG,MAAMP,cAAc,CAACQ,gBAAgB,CAAC,CAAC;IAC9D,IAAID,MAAM,IAAI,0BAA0B,EAAE;MACxC,OAAOE,OAAO,CAACC,OAAO,CAACH,MAAM,CAAC;IAChC,CAAC,MAAM;MACL,OAAOE,OAAO,CAACE,MAAM,CAAC,2BAA2B,CAAC;IACpD;EACF;EACA,IAAIC,KAAK,CAAC,CAAC,EAAE;IACX,MAAML,MAAc,GAAG,MAAMP,cAAc,CAACa,SAAS,CAAC,CAAC;IACvD,I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EACnD;AACF;;AAEA;AACA;AACA;;AAEA;AACA;AACA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { NativeModules, Platform } from 'react-native';
1
+ import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
2
2
  const LINKING_ERROR = `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
3
  ios: "- You have run 'pod install'\n",
4
4
  default: ''
@@ -82,9 +82,44 @@ export function startGrouplinkIOS(withToken) {
82
82
  startIOS(withToken);
83
83
  }
84
84
  }
85
- export function checkBluetooth() {
85
+ export function checkBluetoothIOS() {
86
86
  if (isiOS()) return RNGroupLinkSDK.checkBluetoothIOS();
87
87
  }
88
+ export async function startBluetoothAndroid() {
89
+ if (!(Platform.OS === "android" && Platform.Version >= 31)) return;
90
+ const bluetoothPermission = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN, PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE, PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT]);
91
+ if (bluetoothPermission["android.permission.BLUETOOTH_SCAN"] === PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission["android.permission.BLUETOOTH_ADVERTISE"] === PermissionsAndroid.RESULTS.GRANTED && bluetoothPermission["android.permission.BLUETOOTH_CONNECT"] === PermissionsAndroid.RESULTS.GRANTED) {}
92
+ }
93
+ ;
94
+ export async function startLocationAndroid() {
95
+ if (!(Platform.OS == "android" && Platform.Version >= 23)) return;
96
+ const locationPermission = await PermissionsAndroid.requestMultiple([PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]);
97
+ if (locationPermission["android.permission.ACCESS_COARSE_LOCATION"] === PermissionsAndroid.RESULTS.GRANTED && locationPermission["android.permission.ACCESS_FINE_LOCATION"] === PermissionsAndroid.RESULTS.GRANTED) {
98
+ console.log("Localização ativa.");
99
+ } else {
100
+ console.log("Permissões de localização negadas");
101
+ }
102
+ }
103
+ export function requestFullIntentPermissionAndroid() {
104
+ if (isAndroid()) {
105
+ return RNGroupLinkSDK.requestFullIntentPermissionAndroid();
106
+ }
107
+ }
108
+ export function setNotificationNameAndroid(name) {
109
+ if (isAndroid()) {
110
+ return RNGroupLinkSDK.setNotificationName(name);
111
+ }
112
+ }
113
+ export function getNotificationNameAndroid() {
114
+ if (isAndroid()) {
115
+ return RNGroupLinkSDK.getNotificationName();
116
+ }
117
+ }
118
+ export function requestScheduleExactAlarmPermissionAndroid() {
119
+ if (isAndroid()) {
120
+ return RNGroupLinkSDK.requestScheduleExactAlarm();
121
+ }
122
+ }
88
123
 
89
124
  // function getUserIDiOS(success: (userId: string) => void) {
90
125
  // RNGroupLinkSDK.getUserID(success);
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","getUserId","isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","isiOS","getUserID","setFirebaseToken","token","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","startAndroid","withToken","debbugable","startIOS","startGrouplink","startGrouplinkAndroid","startGrouplinkIOS","checkBluetooth","checkBluetoothIOS"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,wEAAwE,GACxED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAc,GAC/CN,aAAa,CAACM,cAAc,GAC5B,IAAIC,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC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EA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","PermissionsAndroid","Platform","LINKING_ERROR","select","ios","default","RNGroupLinkSDK","Proxy","get","Error","getUserId","isAndroid","userID","getUserIdAndroid","Promise","resolve","reject","isiOS","getUserID","setFirebaseToken","token","console","log","startBluetoothIOS","setDevicePushTokenIOS","setDevicePushToken","startLocationIOS","OS","startAndroid","withToken","debbugable","startIOS","startGrouplink","startGrouplinkAndroid","startGrouplinkIOS","checkBluetoothIOS","startBluetoothAndroid","Version","bluetoothPermission","requestMultiple","PERMISSIONS","BLUETOOTH_SCAN","BLUETOOTH_ADVERTISE","BLUETOOTH_CONNECT","RESULTS","GRANTED","startLocationAndroid","locationPermission","ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION","requestFullIntentPermissionAndroid","setNotificationNameAndroid","name","setNotificationName","getNotificationNameAndroid","getNotificationName","requestScheduleExactAlarmPermissionAndroid","requestScheduleExactAlarm"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAE1E,MAAMC,aAAa,GACjB,wEAAwE,GACxED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,6CAA6C;AAE/C,MAAMC,cAAc,GAAGP,aAAa,CAACO,cAAc,GAC/CP,aAAa,CAACO,cAAc,GAC5B,IAAIC,KAAK,CACT,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEH,OAAO,eAAeQ,SAASA,CAAA,EAA2B;EACxD,IAAIC,SAAS,CAAC,CAAC,EAAE;IACf,MAAMC,MAAc,GAAG,MAAMN,cAAc,CAACO,gBAAgB,CAAC,CAAC;IAC9D,IAAID,MAAM,IAAI,0BAA0B,E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zC,SAAS,CAAC,CAAC,EAAE;IACf,OAAOL,cAAc,CAAC+C,mBAAmB,CAACD,IAAI,CAAC;EACjD;AACF;AAEA,OAAO,SAASE,0BAA0BA,CAAA,EAAG;EAC3C,IAAI3C,SAAS,CAAC,CAAC,EAAE;IACf,OAAOL,cAAc,CAACiD,mBAAmB,CAAC,CAAC;EAC7C;AACF;AAEA,OAAO,SAASC,0CAA0CA,CAAA,EAAG;EAC3D,IAAI7C,SAAS,CAAC,CAAC,EAAE;IACf,OAAOL,cAAc,CAACmD,yBAAyB,CAAC,CAAC;EACnD;AACF;;AAEA;AACA;AACA;;AAEA;AACA;AACA","ignoreList":[]}
@@ -6,5 +6,11 @@ export declare function startLocationIOS(): any;
6
6
  export declare function startGrouplink(withToken: string, debbugable: boolean): void;
7
7
  export declare function startGrouplinkAndroid(withToken: string, debbugable: boolean): void;
8
8
  export declare function startGrouplinkIOS(withToken: string): void;
9
- export declare function checkBluetooth(): any;
9
+ export declare function checkBluetoothIOS(): any;
10
+ export declare function startBluetoothAndroid(): Promise<void>;
11
+ export declare function startLocationAndroid(): Promise<void>;
12
+ export declare function requestFullIntentPermissionAndroid(): any;
13
+ export declare function setNotificationNameAndroid(name: string): any;
14
+ export declare function getNotificationNameAndroid(): any;
15
+ export declare function requestScheduleExactAlarmPermissionAndroid(): any;
10
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,QAK7C;AAED,wBAAgB,iBAAiB,QAMhC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,OAElD;AAED,wBAAgB,gBAAgB,QAM/B;AAmBD,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAOpE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAI3E;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,QAIlD;AAED,wBAAgB,cAAc,QAG7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAmBA,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,QAK7C;AAED,wBAAgB,iBAAiB,QAMhC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,OAElD;AAED,wBAAgB,gBAAgB,QAM/B;AAmBD,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAOpE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAI3E;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,QAIlD;AAED,wBAAgB,iBAAiB,QAGhC;AACD,wBAAsB,qBAAqB,kBAW1C;AACD,wBAAsB,oBAAoB,kBAYzC;AAED,wBAAgB,kCAAkC,QAIjD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAC,MAAM,OAIrD;AAED,wBAAgB,0BAA0B,QAIzC;AAED,wBAAgB,0CAA0C,QAIzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grouplinknetwork/rn-grouplink-sdk",
3
- "version": "2.3.11",
3
+ "version": "2.3.12",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/src/index.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import { NativeModules, Platform } from 'react-native';
1
+ import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
2
2
 
3
3
  const LINKING_ERROR =
4
4
  `The package 'grouplink-sdk' doesn't seem to be linked. Make sure: \n\n` +
@@ -102,10 +102,59 @@ export function startGrouplinkIOS(withToken: string) {
102
102
  }
103
103
  }
104
104
 
105
- export function checkBluetooth() {
105
+ export function checkBluetoothIOS() {
106
106
  if (isiOS())
107
107
  return RNGroupLinkSDK.checkBluetoothIOS();
108
108
  }
109
+ export async function startBluetoothAndroid() {
110
+ if (!(Platform.OS === "android" && Platform.Version >= 31)) return;
111
+
112
+ const bluetoothPermission = await PermissionsAndroid.requestMultiple([
113
+ PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN!,
114
+ PermissionsAndroid.PERMISSIONS.BLUETOOTH_ADVERTISE!,
115
+ PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT!])
116
+ if (bluetoothPermission["android.permission.BLUETOOTH_SCAN"] === PermissionsAndroid.RESULTS.GRANTED
117
+ && bluetoothPermission["android.permission.BLUETOOTH_ADVERTISE"] === PermissionsAndroid.RESULTS.GRANTED
118
+ && bluetoothPermission["android.permission.BLUETOOTH_CONNECT"] === PermissionsAndroid.RESULTS.GRANTED) {
119
+ }
120
+ };
121
+ export async function startLocationAndroid() {
122
+ if (!(Platform.OS == "android" && Platform.Version >= 23)) return;
123
+ const locationPermission = await PermissionsAndroid.requestMultiple([
124
+ PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION!,
125
+ PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION!])
126
+ if (locationPermission["android.permission.ACCESS_COARSE_LOCATION"] === PermissionsAndroid.RESULTS.GRANTED
127
+ && locationPermission["android.permission.ACCESS_FINE_LOCATION"] === PermissionsAndroid.RESULTS.GRANTED
128
+ ) {
129
+ console.log("Localização ativa.");
130
+ } else {
131
+ console.log("Permissões de localização negadas");
132
+ }
133
+ }
134
+
135
+ export function requestFullIntentPermissionAndroid() {
136
+ if (isAndroid()) {
137
+ return RNGroupLinkSDK.requestFullIntentPermissionAndroid();
138
+ }
139
+ }
140
+
141
+ export function setNotificationNameAndroid(name:string) {
142
+ if (isAndroid()) {
143
+ return RNGroupLinkSDK.setNotificationName(name);
144
+ }
145
+ }
146
+
147
+ export function getNotificationNameAndroid() {
148
+ if (isAndroid()) {
149
+ return RNGroupLinkSDK.getNotificationName();
150
+ }
151
+ }
152
+
153
+ export function requestScheduleExactAlarmPermissionAndroid() {
154
+ if (isAndroid()) {
155
+ return RNGroupLinkSDK.requestScheduleExactAlarm();
156
+ }
157
+ }
109
158
 
110
159
  // function getUserIDiOS(success: (userId: string) => void) {
111
160
  // RNGroupLinkSDK.getUserID(success);