@quipuscore/react-native-sms 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +197 -0
  2. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/results.bin +1 -0
  3. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/BuildConfig.dex +0 -0
  4. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkModule$1.dex +0 -0
  5. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkModule$2.dex +0 -0
  6. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkModule$3.dex +0 -0
  7. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkModule$4.dex +0 -0
  8. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkModule.dex +0 -0
  9. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/quipumarket/reactnativesmssdk/SmsSdkPackage.dex +0 -0
  10. package/android/build/.transforms/278baee71bd9f04a200f5e90b2c74ab9/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  11. package/android/build/.transforms/7ce351f0dc5c564181486a677912b850/results.bin +1 -0
  12. package/android/build/.transforms/7ce351f0dc5c564181486a677912b850/transformed/classes/classes_dex/classes.dex +0 -0
  13. package/android/build/generated/source/buildConfig/debug/com/quipumarket/reactnativesmssdk/BuildConfig.java +10 -0
  14. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  15. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  16. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  17. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  18. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  19. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  20. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  21. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  22. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  23. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
  24. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  25. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  26. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/BuildConfig.class +0 -0
  27. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkModule$1.class +0 -0
  28. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkModule$2.class +0 -0
  29. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkModule$3.class +0 -0
  30. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkModule$4.class +0 -0
  31. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkModule.class +0 -0
  32. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/quipumarket/reactnativesmssdk/SmsSdkPackage.class +0 -0
  33. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  34. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  35. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  36. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  37. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  38. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/BuildConfig.class +0 -0
  39. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkModule$1.class +0 -0
  40. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkModule$2.class +0 -0
  41. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkModule$3.class +0 -0
  42. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkModule$4.class +0 -0
  43. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkModule.class +0 -0
  44. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/quipumarket/reactnativesmssdk/SmsSdkPackage.class +0 -0
  45. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  46. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  47. package/android/build/outputs/logs/manifest-merger-debug-report.txt +16 -0
  48. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  49. package/android/build.gradle +31 -0
  50. package/android/src/main/AndroidManifest.xml +2 -0
  51. package/android/src/main/java/com/quipumarket/reactnativesmssdk/SmsSdkModule.java +210 -0
  52. package/android/src/main/java/com/quipumarket/reactnativesmssdk/SmsSdkPackage.java +29 -0
  53. package/package.json +26 -0
  54. package/react-native.config.js +8 -0
  55. package/src/index.ts +83 -0
package/README.md ADDED
@@ -0,0 +1,197 @@
1
+ # React Native SMS SDK
2
+
3
+ A React Native library to read and sync SMS messages on Android devices. It wraps the Quipu Bank SMS SDK (`com.quipubank:sms-sdk`) published on Maven Central.
4
+
5
+ > **Note:** This library is **Android-only**. SMS reading is not supported on iOS.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @quipuscore/react-native-sms
11
+ ```
12
+
13
+ If using Expo, run a development build (custom native code is not supported in Expo Go):
14
+
15
+ ```bash
16
+ npx expo prebuild --platform android
17
+ npx expo run:android
18
+ ```
19
+
20
+ ## Requirements
21
+
22
+ - React Native 0.60+ (auto-linking)
23
+ - Android API level 24+ (minSdk in the library)
24
+ - For Expo: use a development build, not Expo Go
25
+
26
+ ## Configuration
27
+
28
+ ### Android
29
+
30
+ Add the **READ_SMS** permission to your app (e.g. in `app.json` for Expo, or `AndroidManifest.xml`):
31
+
32
+ ```xml
33
+ <uses-permission android:name="android.permission.READ_SMS" />
34
+ ```
35
+
36
+ Request `READ_SMS` at runtime before calling `readSms()` or `collectAndSync()` (e.g. with `PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_SMS, ...)`).
37
+
38
+ `INTERNET` and `ACCESS_NETWORK_STATE` are declared by the underlying Quipu SDK and are merged into your app automatically; you do not need to add them yourself.
39
+
40
+ **Verifying merged permissions:** After building the Android app, open the manifest merger report at `android/app/build/outputs/logs/manifest-merger-debug-report.txt` and search for `com.quipubank:sms-sdk` — you will see `MERGED from [com.quipubank:sms-sdk:0.0.1]` for `INTERNET` and `ACCESS_NETWORK_STATE`.
41
+
42
+ ## Usage
43
+
44
+ ### Initialize the SDK
45
+
46
+ ```typescript
47
+ import SmsSdk from '@quipuscore/react-native-sms';
48
+
49
+ // Initialize with client ID and token
50
+ const result = await SmsSdk.initialize('YOUR_CLIENT_ID', 'YOUR_API_TOKEN');
51
+ ```
52
+
53
+ ### Read and sync SMS messages
54
+
55
+ ```typescript
56
+ // Collect SMS and sync to the server in one operation
57
+ try {
58
+ const result = await SmsSdk.collectAndSync({
59
+ deviceId: 'device456',
60
+ userId: 'user123', // optional
61
+ });
62
+ console.log(result.message, result.count);
63
+ } catch (error) {
64
+ console.error('Error reading or syncing SMS:', error);
65
+ }
66
+ ```
67
+
68
+ ### Link user with device
69
+
70
+ ```typescript
71
+ await SmsSdk.linkUserIdWithDevice('userId', 'deviceId');
72
+ ```
73
+
74
+ ## API
75
+
76
+ <docgen-index>
77
+
78
+ * [`initialize(...)`](#initialize)
79
+ * [`collectAndSync(...)`](#collectandsync)
80
+ * [`linkUserIdWithDevice(...)`](#linkuseridwithdevice)
81
+ * [Interfaces](#interfaces)
82
+
83
+ </docgen-index>
84
+
85
+ <docgen-api>
86
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
87
+
88
+ Public interface for the SMS plugin - exposing initialize, collectAndSync, and linkUserIdWithDevice methods
89
+
90
+ ### initialize(...)
91
+
92
+ ```typescript
93
+ initialize(options: InitializeOptions) => Promise<InitializeResult>
94
+ ```
95
+
96
+ Initialize the SMS plugin with a token
97
+
98
+ | Param | Type | Description |
99
+ | ------------- | --------------------------------------------------------------- | ------------------------------------------- |
100
+ | **`options`** | <code><a href="#initializeoptions">InitializeOptions</a></code> | Options containing the authentication token |
101
+
102
+ **Returns:** <code>Promise&lt;<a href="#initializeresult">InitializeResult</a>&gt;</code>
103
+
104
+ --------------------
105
+
106
+
107
+ ### collectAndSync(...)
108
+
109
+ ```typescript
110
+ collectAndSync(options: CollectAndSyncOptions) => Promise<SyncSmsResult>
111
+ ```
112
+
113
+ Collect SMS messages and sync them to the server in one operation
114
+
115
+ | Param | Type | Description |
116
+ | ------------- | ----------------------------------------------------------------------- | -------------------------------------- |
117
+ | **`options`** | <code><a href="#collectandsyncoptions">CollectAndSyncOptions</a></code> | Options containing userId and deviceId |
118
+
119
+ **Returns:** <code>Promise&lt;<a href="#syncsmsresult">SyncSmsResult</a>&gt;</code>
120
+
121
+ --------------------
122
+
123
+
124
+ ### linkUserIdWithDevice(...)
125
+
126
+ ```typescript
127
+ linkUserIdWithDevice(options: LinkUserIdWithDeviceOptions) => Promise<LinkUserIdWithDeviceResult>
128
+ ```
129
+
130
+ Link a user ID with a device ID
131
+
132
+ | Param | Type | Description |
133
+ | ------------- | ----------------------------------------------------------------------------------- | -------------------------------------- |
134
+ | **`options`** | <code><a href="#linkuseridwithdeviceoptions">LinkUserIdWithDeviceOptions</a></code> | Options containing userId and deviceId |
135
+
136
+ **Returns:** <code>Promise&lt;<a href="#linkuseridwithdeviceresult">LinkUserIdWithDeviceResult</a>&gt;</code>
137
+
138
+ --------------------
139
+
140
+
141
+ ### Interfaces
142
+
143
+
144
+ #### InitializeResult
145
+
146
+ | Prop | Type |
147
+ | ------------- | -------------------- |
148
+ | **`success`** | <code>boolean</code> |
149
+ | **`message`** | <code>string</code> |
150
+
151
+
152
+ #### InitializeOptions
153
+
154
+ | Prop | Type | Description |
155
+ | -------------- | ------------------- | ---------------------------------------------------------------------------------------- |
156
+ | **`clientId`** | <code>string</code> | Client ID for identification |
157
+ | **`token`** | <code>string</code> | API token for authentication - this also determines the environment (sandbox/production) |
158
+
159
+
160
+ #### SyncSmsResult
161
+
162
+ | Prop | Type |
163
+ | ------------- | -------------------- |
164
+ | **`success`** | <code>boolean</code> |
165
+ | **`message`** | <code>string</code> |
166
+
167
+
168
+ #### CollectAndSyncOptions
169
+
170
+ | Prop | Type | Description |
171
+ | -------------------- | ------------------- | ------------------------ |
172
+ | **`deviceId`** | <code>string</code> | |
173
+ | **`userId`** | <code>string</code> | Optional user ID |
174
+ | **`identityNumber`** | <code>string</code> | Optional identity number |
175
+ | **`identityType`** | <code>string</code> | Optional identity type |
176
+
177
+
178
+ #### LinkUserIdWithDeviceResult
179
+
180
+ | Prop | Type |
181
+ | ------------- | -------------------- |
182
+ | **`success`** | <code>boolean</code> |
183
+ | **`message`** | <code>string</code> |
184
+
185
+
186
+ #### LinkUserIdWithDeviceOptions
187
+
188
+ | Prop | Type | Description |
189
+ | -------------- | ------------------- | ------------------------------- |
190
+ | **`userId`** | <code>string</code> | User ID to link with the device |
191
+ | **`deviceId`** | <code>string</code> | Device ID to link with the user |
192
+
193
+ </docgen-api>
194
+
195
+ ## License
196
+
197
+ Apache-2.0
@@ -0,0 +1 @@
1
+ o/bundleLibRuntimeToDirDebug
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Automatically generated file. DO NOT MODIFY
3
+ */
4
+ package com.quipumarket.reactnativesmssdk;
5
+
6
+ public final class BuildConfig {
7
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
8
+ public static final String LIBRARY_PACKAGE_NAME = "com.quipumarket.reactnativesmssdk";
9
+ public static final String BUILD_TYPE = "debug";
10
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.quipumarket.reactnativesmssdk" >
4
+
5
+ <uses-sdk android:minSdkVersion="24" />
6
+
7
+ </manifest>
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "artifactType": {
4
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
+ "kind": "Directory"
6
+ },
7
+ "applicationId": "com.quipumarket.reactnativesmssdk",
8
+ "variantName": "debug",
9
+ "elements": [
10
+ {
11
+ "type": "SINGLE",
12
+ "filters": [],
13
+ "attributes": [],
14
+ "outputFile": "AndroidManifest.xml"
15
+ }
16
+ ],
17
+ "elementType": "File"
18
+ }
@@ -0,0 +1,6 @@
1
+ aarFormatVersion=1.0
2
+ aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minCompileSdkExtension=0
5
+ minAndroidGradlePluginVersion=1.0.0
6
+ coreLibraryDesugaringEnabled=false
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/debug/jniLibs"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/debug/shaders"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ R_DEF: Internal format may change without notice
2
+ local
@@ -0,0 +1,7 @@
1
+ 1<?xml version="1.0" encoding="utf-8"?>
2
+ 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ 3 package="com.quipumarket.reactnativesmssdk" >
4
+ 4
5
+ 5 <uses-sdk android:minSdkVersion="24" />
6
+ 6
7
+ 7</manifest>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.quipumarket.reactnativesmssdk" >
4
+
5
+ <uses-sdk android:minSdkVersion="24" />
6
+
7
+ </manifest>
@@ -0,0 +1,16 @@
1
+ -- Merging decision tree log ---
2
+ manifest
3
+ ADDED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml:1:1-2:12
4
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml:1:1-2:12
5
+ package
6
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml
7
+ xmlns:android
8
+ ADDED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml:1:11-69
9
+ uses-sdk
10
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
11
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml
12
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml
13
+ android:targetSdkVersion
14
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml
15
+ android:minSdkVersion
16
+ INJECTED from /Users/leandrovignoni/Documents/quipu/projects/quipumarket-ionic-plugins/get-sms-plugin-v2/react-native-sms-sdk-2026-02-09/android/src/main/AndroidManifest.xml
@@ -0,0 +1,31 @@
1
+ apply plugin: 'com.android.library'
2
+
3
+ def safeExtGet(prop, fallback) {
4
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5
+ }
6
+
7
+ android {
8
+ namespace "com.quipumarket.reactnativesmssdk"
9
+ compileSdkVersion safeExtGet('compileSdkVersion', 34)
10
+
11
+ defaultConfig {
12
+ minSdkVersion safeExtGet('minSdkVersion', 24)
13
+ targetSdkVersion safeExtGet('targetSdkVersion', 34)
14
+ }
15
+
16
+ compileOptions {
17
+ sourceCompatibility JavaVersion.VERSION_17
18
+ targetCompatibility JavaVersion.VERSION_17
19
+ }
20
+ }
21
+
22
+ repositories {
23
+ mavenCentral()
24
+ google()
25
+ }
26
+
27
+ dependencies {
28
+ //noinspection GradleDynamicVersion
29
+ implementation 'com.facebook.react:react-android:+'
30
+ implementation 'com.quipubank:sms-sdk:0.0.1'
31
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,210 @@
1
+ package com.quipumarket.reactnativesmssdk;
2
+
3
+ import android.util.Log;
4
+
5
+ import androidx.annotation.NonNull;
6
+
7
+ import com.facebook.react.bridge.Arguments;
8
+ import com.facebook.react.bridge.Promise;
9
+ import com.facebook.react.bridge.ReactApplicationContext;
10
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
11
+ import com.facebook.react.bridge.ReactMethod;
12
+ import com.facebook.react.bridge.ReadableMap;
13
+ import com.facebook.react.bridge.WritableArray;
14
+ import com.facebook.react.bridge.WritableMap;
15
+
16
+ import com.quipumarket.sms.AuthCallback;
17
+ import com.quipumarket.sms.CombinedCallback;
18
+ import com.quipumarket.sms.SmsCallback;
19
+ import com.quipumarket.sms.SmsMessage;
20
+ import com.quipumarket.sms.SmsReader;
21
+ import com.quipumarket.sms.SmsReaderImpl;
22
+ import com.quipumarket.sms.SyncCallback;
23
+
24
+ import java.text.SimpleDateFormat;
25
+ import java.util.List;
26
+ import java.util.Locale;
27
+
28
+ public class SmsSdkModule extends ReactContextBaseJavaModule {
29
+
30
+ private static final String TAG = "SmsSdkModule";
31
+ private final SmsReader smsReader;
32
+
33
+ public SmsSdkModule(ReactApplicationContext reactContext) {
34
+ super(reactContext);
35
+ smsReader = new SmsReaderImpl(reactContext);
36
+ }
37
+
38
+ @Override
39
+ @NonNull
40
+ public String getName() {
41
+ return "SmsSdk";
42
+ }
43
+
44
+ @ReactMethod
45
+ public void initialize(String clientId, String token, Promise promise) {
46
+ if (clientId == null || clientId.isEmpty()) {
47
+ promise.reject("INVALID_CLIENT_ID", "A valid clientId must be provided.");
48
+ return;
49
+ }
50
+ if (token == null || token.isEmpty()) {
51
+ promise.reject("INVALID_TOKEN", "A valid token must be provided.");
52
+ return;
53
+ }
54
+
55
+ Log.i(TAG, "Initializing SMS SDK with clientId and token");
56
+
57
+ smsReader.initialize(clientId, token, new AuthCallback() {
58
+ @Override
59
+ public void onAuthSuccess() {
60
+ WritableMap result = Arguments.createMap();
61
+ result.putBoolean("success", true);
62
+ result.putString("message", "Initialization successful");
63
+ promise.resolve(result);
64
+ }
65
+
66
+ @Override
67
+ public void onAuthError(Exception error) {
68
+ promise.reject("AUTH_ERROR", "Authentication failed: " + error.getMessage(), error);
69
+ }
70
+ });
71
+ }
72
+
73
+ @ReactMethod
74
+ public void isInitialized(Promise promise) {
75
+ promise.resolve(smsReader.isInitialized());
76
+ }
77
+
78
+ @ReactMethod
79
+ public void readSms(Promise promise) {
80
+ if (!smsReader.isInitialized()) {
81
+ promise.reject("NOT_INITIALIZED", "SDK not initialized. Call initialize() first.");
82
+ return;
83
+ }
84
+
85
+ smsReader.readSms(new SmsCallback() {
86
+ @Override
87
+ public void onSuccess(List<SmsMessage> messages) {
88
+ WritableArray smsArray = Arguments.createArray();
89
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
90
+
91
+ for (SmsMessage message : messages) {
92
+ WritableMap smsMap = Arguments.createMap();
93
+ smsMap.putString("address", message.getAddress());
94
+ smsMap.putString("body", message.getBody());
95
+ smsMap.putString("creator", message.getCreator());
96
+ if (message.getDate() != null) {
97
+ smsMap.putString("date", sdf.format(message.getDate()));
98
+ }
99
+ smsArray.pushMap(smsMap);
100
+ }
101
+
102
+ WritableMap result = Arguments.createMap();
103
+ result.putArray("messages", smsArray);
104
+ result.putInt("count", messages.size());
105
+ promise.resolve(result);
106
+ }
107
+
108
+ @Override
109
+ public void onError(Exception error) {
110
+ promise.reject("READ_ERROR", "Error reading SMS: " + error.getMessage(), error);
111
+ }
112
+ });
113
+ }
114
+
115
+ @ReactMethod
116
+ public void collectAndSync(ReadableMap options, Promise promise) {
117
+ if (!smsReader.isInitialized()) {
118
+ promise.reject("NOT_INITIALIZED", "SDK not initialized. Call initialize() first.");
119
+ return;
120
+ }
121
+
122
+ String deviceId = options.hasKey("deviceId") ? options.getString("deviceId") : null;
123
+ String userId = options.hasKey("userId") ? options.getString("userId") : null;
124
+ String identityNumber = options.hasKey("identityNumber") ? options.getString("identityNumber") : null;
125
+ String identityType = options.hasKey("identityType") ? options.getString("identityType") : null;
126
+
127
+ if (deviceId == null || deviceId.isEmpty()) {
128
+ promise.reject("INVALID_DEVICE_ID", "deviceId is required for collectAndSync");
129
+ return;
130
+ }
131
+
132
+ Log.d(TAG, "Collecting and syncing SMS for deviceId: " + deviceId);
133
+
134
+ smsReader.collectAndSync(deviceId, userId, identityNumber, identityType, new CombinedCallback() {
135
+ @Override
136
+ public void onSuccess(List<SmsMessage> messages) {
137
+ WritableMap result = Arguments.createMap();
138
+ result.putBoolean("success", true);
139
+ result.putString("message", "Successfully collected and synced " + messages.size() + " SMS messages");
140
+ result.putInt("count", messages.size());
141
+ promise.resolve(result);
142
+ }
143
+
144
+ @Override
145
+ public void onReadError(Exception e) {
146
+ promise.reject("READ_ERROR", "Error reading SMS: " + e.getMessage(), e);
147
+ }
148
+
149
+ @Override
150
+ public void onSyncError(List<SmsMessage> messages, Exception e) {
151
+ promise.reject("SYNC_ERROR", "SMS read succeeded but sync failed: " + e.getMessage(), e);
152
+ }
153
+ });
154
+ }
155
+
156
+ @ReactMethod
157
+ public void linkUserIdWithDevice(String userId, String deviceId, Promise promise) {
158
+ if (!smsReader.isInitialized()) {
159
+ promise.reject("NOT_INITIALIZED", "SDK not initialized. Call initialize() first.");
160
+ return;
161
+ }
162
+
163
+ if (userId == null || userId.isEmpty()) {
164
+ promise.reject("INVALID_USER_ID", "userId is required");
165
+ return;
166
+ }
167
+
168
+ if (deviceId == null || deviceId.isEmpty()) {
169
+ promise.reject("INVALID_DEVICE_ID", "deviceId is required");
170
+ return;
171
+ }
172
+
173
+ Log.d(TAG, "Linking userId: " + userId + " with device: " + deviceId);
174
+
175
+ smsReader.linkUserIdWithDevice(userId, deviceId, new SyncCallback() {
176
+ @Override
177
+ public void onSuccess() {
178
+ WritableMap result = Arguments.createMap();
179
+ result.putBoolean("success", true);
180
+ result.putString("message", "Successfully linked userId with device");
181
+ promise.resolve(result);
182
+ }
183
+
184
+ @Override
185
+ public void onError(Exception e) {
186
+ promise.reject("LINK_ERROR", "Error linking userId with device: " + e.getMessage(), e);
187
+ }
188
+ });
189
+ }
190
+
191
+ @ReactMethod
192
+ public void setSyncEndpoint(String endpoint, Promise promise) {
193
+ try {
194
+ smsReader.setSyncEndpoint(endpoint);
195
+ promise.resolve(true);
196
+ } catch (Exception e) {
197
+ promise.reject("SET_ENDPOINT_ERROR", "Error setting sync endpoint: " + e.getMessage(), e);
198
+ }
199
+ }
200
+
201
+ @ReactMethod
202
+ public void setBatchSize(double batchSize, Promise promise) {
203
+ try {
204
+ smsReader.setBatchSize((int) batchSize);
205
+ promise.resolve(true);
206
+ } catch (Exception e) {
207
+ promise.reject("SET_BATCH_SIZE_ERROR", "Error setting batch size: " + e.getMessage(), e);
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,29 @@
1
+ package com.quipumarket.reactnativesmssdk;
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 SmsSdkPackage implements ReactPackage {
15
+
16
+ @NonNull
17
+ @Override
18
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
19
+ List<NativeModule> modules = new ArrayList<>();
20
+ modules.add(new SmsSdkModule(reactContext));
21
+ return modules;
22
+ }
23
+
24
+ @NonNull
25
+ @Override
26
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
27
+ return Collections.emptyList();
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@quipuscore/react-native-sms",
3
+ "version": "0.0.1",
4
+ "description": "React Native library for reading and syncing SMS messages on Android devices.",
5
+ "main": "src/index.ts",
6
+ "source": "src/index.ts",
7
+ "react-native": "src/index.ts",
8
+ "types": "src/index.ts",
9
+ "files": [
10
+ "src",
11
+ "android",
12
+ "react-native.config.js"
13
+ ],
14
+ "scripts": {},
15
+ "keywords": [
16
+ "react-native",
17
+ "sms",
18
+ "sdk",
19
+ "quipubank"
20
+ ],
21
+ "peerDependencies": {
22
+ "react": "*",
23
+ "react-native": "*"
24
+ },
25
+ "license": "Apache-2.0"
26
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ dependency: {
3
+ platforms: {
4
+ android: {},
5
+ ios: null, // No iOS support — this SDK is Android only
6
+ },
7
+ },
8
+ };
package/src/index.ts ADDED
@@ -0,0 +1,83 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package 'react-native-sms-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 Go (custom native code requires a development build)\n';
8
+
9
+ const SmsSdk = NativeModules.SmsSdk
10
+ ? NativeModules.SmsSdk
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
+
20
+ // --- Type definitions ---
21
+
22
+ export interface InitializeResult {
23
+ success: boolean;
24
+ message: string;
25
+ }
26
+
27
+ export interface CollectAndSyncOptions {
28
+ deviceId: string;
29
+ userId?: string;
30
+ identityNumber?: string;
31
+ identityType?: string;
32
+ }
33
+
34
+ export interface CollectAndSyncResult {
35
+ success: boolean;
36
+ message: string;
37
+ count: number;
38
+ }
39
+
40
+ export interface LinkResult {
41
+ success: boolean;
42
+ message: string;
43
+ }
44
+
45
+ // --- Public API ---
46
+
47
+ /**
48
+ * Initialize the SMS SDK with authentication credentials.
49
+ * Must be called before any other SDK method.
50
+ */
51
+ export function initialize(
52
+ clientId: string,
53
+ token: string
54
+ ): Promise<InitializeResult> {
55
+ return SmsSdk.initialize(clientId, token);
56
+ }
57
+
58
+ /**
59
+ * Collect SMS messages from the device and sync them to the server
60
+ * in a single operation.
61
+ * Requires READ_SMS permission to be granted.
62
+ */
63
+ export function collectAndSync(
64
+ options: CollectAndSyncOptions
65
+ ): Promise<CollectAndSyncResult> {
66
+ return SmsSdk.collectAndSync(options);
67
+ }
68
+
69
+ /**
70
+ * Link a user ID with a device ID on the server.
71
+ */
72
+ export function linkUserIdWithDevice(
73
+ userId: string,
74
+ deviceId: string
75
+ ): Promise<LinkResult> {
76
+ return SmsSdk.linkUserIdWithDevice(userId, deviceId);
77
+ }
78
+
79
+ export default {
80
+ initialize,
81
+ collectAndSync,
82
+ linkUserIdWithDevice,
83
+ };