react-native-risk-sdk 1.4.16 → 1.4.21
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/README.md +6 -8
- package/android/.gradle/8.0.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.0.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +21 -18
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/AndroidManifest.xml +1 -2
- package/android/src/main/java/in/finbox/mobileriskmanagerreact/RiskSdkModule.java +71 -5
- package/package.json +7 -4
- package/android/README.md +0 -14
package/README.md
CHANGED
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Getting started
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`$ react-native link react-native-risk-sdk`
|
|
5
|
+
```commandline
|
|
6
|
+
npm install react-native-risk-sdk --save
|
|
7
|
+
```
|
|
10
8
|
|
|
11
9
|
## Usage
|
|
10
|
+
|
|
12
11
|
```javascript
|
|
13
12
|
import RiskSdk from 'react-native-risk-sdk';
|
|
14
|
-
|
|
15
|
-
// TODO: What to do with the module?
|
|
16
|
-
RiskSdk;
|
|
17
13
|
```
|
|
14
|
+
|
|
15
|
+
For more details on integration, refer to <https://docs.finbox.in/device-connect/react-native.html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Fri
|
|
1
|
+
#Fri May 24 11:55:21 IST 2024
|
|
2
2
|
gradle.version=8.0.1
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
arguments=--init-script /var/folders/
|
|
1
|
+
arguments=--init-script /var/folders/qk/lnk1fgv10flcdrwx293w8wxw0000gn/T/d146c9752a26f79b52047fb6dc6ed385d064e120494f96f08ca63a317c41f94c.gradle --init-script /var/folders/qk/lnk1fgv10flcdrwx293w8wxw0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
|
2
2
|
auto.sync=false
|
|
3
3
|
build.scans.enabled=false
|
|
4
4
|
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
package/android/build.gradle
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// original location:
|
|
11
11
|
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
|
|
12
12
|
|
|
13
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
13
|
+
def DEFAULT_COMPILE_SDK_VERSION = 34
|
|
14
14
|
def DEFAULT_MIN_SDK_VERSION = 21
|
|
15
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
15
|
+
def DEFAULT_TARGET_SDK_VERSION = 34
|
|
16
16
|
|
|
17
17
|
Properties properties = new Properties()
|
|
18
18
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
@@ -35,13 +35,15 @@ buildscript {
|
|
|
35
35
|
// This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
36
36
|
// module dependency in an application project.
|
|
37
37
|
// ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
|
|
38
|
+
|
|
38
39
|
if (project == rootProject) {
|
|
39
40
|
repositories {
|
|
40
41
|
google()
|
|
41
42
|
jcenter()
|
|
43
|
+
mavenCentral()
|
|
42
44
|
}
|
|
43
45
|
dependencies {
|
|
44
|
-
classpath 'com.android.tools.build:gradle:
|
|
46
|
+
classpath 'com.android.tools.build:gradle:8.0.2'
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
}
|
|
@@ -50,13 +52,13 @@ apply plugin: 'com.android.library'
|
|
|
50
52
|
apply plugin: 'maven-publish'
|
|
51
53
|
|
|
52
54
|
android {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
compileSdk safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
|
|
56
|
+
namespace 'in.finbox.mobileriskmanagerreact'
|
|
55
57
|
defaultConfig {
|
|
56
58
|
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
|
|
57
59
|
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
|
|
58
|
-
versionCode
|
|
59
|
-
versionName "1.
|
|
60
|
+
versionCode 3
|
|
61
|
+
versionName "1.2"
|
|
60
62
|
}
|
|
61
63
|
lintOptions {
|
|
62
64
|
abortOnError false
|
|
@@ -76,6 +78,7 @@ repositories {
|
|
|
76
78
|
// }
|
|
77
79
|
google()
|
|
78
80
|
jcenter()
|
|
81
|
+
mavenCentral()
|
|
79
82
|
maven {
|
|
80
83
|
url "s3://risk-manager-android-sdk/artifacts"
|
|
81
84
|
credentials(AwsCredentials) {
|
|
@@ -91,7 +94,7 @@ repositories {
|
|
|
91
94
|
|
|
92
95
|
dependencies {
|
|
93
96
|
//noinspection GradleDynamicVersion
|
|
94
|
-
implementation
|
|
97
|
+
implementation "com.facebook.react:react-android:0.73.6" // From node_modules
|
|
95
98
|
implementation("in.finbox:mobileriskmanager:${riskVersion}:parent-release@aar") {
|
|
96
99
|
transitive = true
|
|
97
100
|
}
|
|
@@ -154,17 +157,17 @@ afterEvaluate { project ->
|
|
|
154
157
|
// }
|
|
155
158
|
// }
|
|
156
159
|
project.getConfigurations().getByName('implementation').setCanBeResolved(true)
|
|
157
|
-
classpath += files(project.getConfigurations().getByName('implementation').asList())
|
|
160
|
+
// classpath += files(project.getConfigurations().getByName('implementation').asList())
|
|
158
161
|
include '**/*.java'
|
|
159
162
|
}
|
|
160
163
|
|
|
161
164
|
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
|
162
|
-
|
|
165
|
+
archiveClassifier = 'javadoc'
|
|
163
166
|
from androidJavadoc.destinationDir
|
|
164
167
|
}
|
|
165
168
|
|
|
166
169
|
task androidSourcesJar(type: Jar) {
|
|
167
|
-
|
|
170
|
+
archiveClassifier = 'sources'
|
|
168
171
|
from android.sourceSets.main.java.srcDirs
|
|
169
172
|
include '**/*.java'
|
|
170
173
|
}
|
|
@@ -188,11 +191,11 @@ afterEvaluate { project ->
|
|
|
188
191
|
archives androidJavadocJar
|
|
189
192
|
}
|
|
190
193
|
|
|
191
|
-
task installArchives(type: Upload) {
|
|
192
|
-
configuration = configurations.archives
|
|
193
|
-
repositories.maven {
|
|
194
|
-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
|
|
195
|
-
url = uri("file://${projectDir}/../android/maven")
|
|
196
|
-
}
|
|
197
|
-
}
|
|
194
|
+
// task installArchives(type: Upload) {
|
|
195
|
+
// configuration = configurations.archives
|
|
196
|
+
// repositories.maven {
|
|
197
|
+
// // Deploy to react-native-event-bridge/maven, ready to publish to npm
|
|
198
|
+
// url = uri("file://${projectDir}/../android/maven")
|
|
199
|
+
// }
|
|
200
|
+
// }
|
|
198
201
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#Wed Nov 02 18:15:26 IST 2022
|
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
|
|
4
4
|
distributionPath=wrapper/dists
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
|
@@ -2,23 +2,28 @@ package in.finbox.mobileriskmanagerreact;
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
import androidx.annotation.NonNull;
|
|
5
|
+
import androidx.annotation.Nullable;
|
|
5
6
|
|
|
6
7
|
import com.facebook.react.bridge.Callback;
|
|
7
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
8
9
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
9
10
|
import com.facebook.react.bridge.ReactMethod;
|
|
11
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
10
12
|
|
|
11
13
|
import java.util.HashMap;
|
|
12
14
|
import java.util.Map;
|
|
13
15
|
import java.util.concurrent.TimeUnit;
|
|
14
16
|
|
|
15
|
-
import javax.annotation.Nullable;
|
|
16
17
|
|
|
17
18
|
import in.finbox.mobileriskmanager.FinBox;
|
|
18
19
|
import in.finbox.mobileriskmanager.common.annotations.FinBoxErrorCode;
|
|
20
|
+
import in.finbox.mobileriskmanager.devicematch.DeviceMatch;
|
|
21
|
+
import in.finbox.mobileriskmanager.notifications.MessagingService;
|
|
19
22
|
|
|
20
23
|
public class RiskSdkModule extends ReactContextBaseJavaModule {
|
|
21
24
|
|
|
25
|
+
private final FinBox finbox = new FinBox();
|
|
26
|
+
|
|
22
27
|
private final ReactApplicationContext reactContext;
|
|
23
28
|
private static String QUOTA_LIMIT_EXCEEDED = "QUOTA_LIMIT_EXCEEDED";
|
|
24
29
|
private static String AUTHENTICATE_FAILED = "AUTHENTICATE_FAILED";
|
|
@@ -79,21 +84,82 @@ public class RiskSdkModule extends ReactContextBaseJavaModule {
|
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
@ReactMethod
|
|
82
|
-
public void startPeriodicSync(
|
|
83
|
-
FinBox finbox = new FinBox();
|
|
87
|
+
public void startPeriodicSync(int duration) {
|
|
84
88
|
finbox.setRealTime(true);
|
|
85
89
|
finbox.setSyncFrequency(TimeUnit.HOURS.toSeconds(duration));
|
|
86
90
|
finbox.startPeriodicSync();
|
|
87
91
|
}
|
|
88
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Sync the data once
|
|
95
|
+
*/
|
|
96
|
+
@ReactMethod
|
|
97
|
+
public void syncOnce() {
|
|
98
|
+
finbox.syncOnce();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@ReactMethod
|
|
102
|
+
public void setDeviceMatch(@Nullable String email, @Nullable String name, @Nullable String phone) {
|
|
103
|
+
final DeviceMatch.Builder deviceMatchBuilder = new DeviceMatch.Builder();
|
|
104
|
+
if (email != null) {
|
|
105
|
+
deviceMatchBuilder.setEmail(email);
|
|
106
|
+
}
|
|
107
|
+
if (name != null) {
|
|
108
|
+
deviceMatchBuilder.setName(name);
|
|
109
|
+
}
|
|
110
|
+
if (phone != null) {
|
|
111
|
+
deviceMatchBuilder.setPhone(phone);
|
|
112
|
+
}
|
|
113
|
+
finbox.setDeviceMatch(deviceMatchBuilder.build());
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Forward the FCM notifications to SDK
|
|
118
|
+
*/
|
|
119
|
+
@ReactMethod
|
|
120
|
+
public void forwardFinBoxNotificationToSDK(@NonNull ReadableMap data) {
|
|
121
|
+
Map<String, String> dataMap = (Map) data.toHashMap();
|
|
122
|
+
if (MessagingService.forwardToFinBoxSDK(dataMap)) {
|
|
123
|
+
// FinBox Firebase Message
|
|
124
|
+
MessagingService firebaseMessagingService = new MessagingService(reactContext);
|
|
125
|
+
firebaseMessagingService.onMessageReceived(dataMap);
|
|
126
|
+
} else {
|
|
127
|
+
// Nothing to do
|
|
128
|
+
// Irrelevant to FinBox SDk
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Set the sync frequency
|
|
134
|
+
* @param duration Time to set the frequency
|
|
135
|
+
*/
|
|
136
|
+
@ReactMethod
|
|
137
|
+
public void setSyncFrequency(Integer duration) {
|
|
138
|
+
finbox.setSyncFrequency(duration);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Stop sending the data
|
|
143
|
+
*/
|
|
89
144
|
@ReactMethod
|
|
90
145
|
public void stopPeriodicSync() {
|
|
91
|
-
|
|
146
|
+
finbox.stopPeriodicSync();
|
|
92
147
|
}
|
|
93
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Delete the user information from the local device
|
|
151
|
+
*/
|
|
94
152
|
@ReactMethod
|
|
95
|
-
public void
|
|
153
|
+
public void resetData() {
|
|
96
154
|
FinBox.resetData();
|
|
97
155
|
}
|
|
98
156
|
|
|
157
|
+
/**
|
|
158
|
+
* Delete the user information from the server
|
|
159
|
+
*/
|
|
160
|
+
@ReactMethod
|
|
161
|
+
public void forgetUser() {
|
|
162
|
+
FinBox.forgetUser();
|
|
163
|
+
}
|
|
164
|
+
|
|
99
165
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-risk-sdk",
|
|
3
3
|
"title": "React Native Risk Sdk",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.21",
|
|
5
5
|
"description": "A Wrapper around the Risk Android SDK",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"react-native"
|
|
17
17
|
],
|
|
18
18
|
"author": {
|
|
19
|
-
"name": "
|
|
20
|
-
"email": "
|
|
19
|
+
"name": "Srikar Reddy",
|
|
20
|
+
"email": "srikar@finbox.in"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"licenseFilename": "LICENSE",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
"react-native": ">=0.59.0-rc.0 <1.0.x"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"react-native": "
|
|
29
|
+
"react-native": "0.73.6"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"react": "18.2.0"
|
|
30
33
|
}
|
|
31
34
|
}
|
package/android/README.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
README
|
|
2
|
-
======
|
|
3
|
-
|
|
4
|
-
If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
|
|
5
|
-
|
|
6
|
-
1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
|
|
7
|
-
2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
|
|
8
|
-
```
|
|
9
|
-
ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
|
|
10
|
-
sdk.dir=/Users/{username}/Library/Android/sdk
|
|
11
|
-
```
|
|
12
|
-
3. Delete the `maven` folder
|
|
13
|
-
4. Run `./gradlew installArchives`
|
|
14
|
-
5. Verify that latest set of generated files is in the maven folder with the correct version number
|