react-native-risk-sdk 1.4.15 → 1.4.20
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/.vscode/settings.json +3 -0
- package/README.md +6 -8
- package/android/.classpath +1 -1
- 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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.project +2 -2
- package/android/.settings/org.eclipse.buildship.core.prefs +1 -1
- package/android/build.gradle +30 -21
- 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 +63 -5
- package/package.json +8 -5
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- 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>
|
package/android/.classpath
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<classpath>
|
|
3
|
-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-
|
|
3
|
+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14/"/>
|
|
4
4
|
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
|
5
5
|
<classpathentry kind="output" path="bin/default"/>
|
|
6
6
|
</classpath>
|
|
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
|
package/android/.project
CHANGED
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
</natures>
|
|
23
23
|
<filteredResources>
|
|
24
24
|
<filter>
|
|
25
|
-
<id>
|
|
25
|
+
<id>1667324496906</id>
|
|
26
26
|
<name></name>
|
|
27
27
|
<type>30</type>
|
|
28
28
|
<matcher>
|
|
29
29
|
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
-
<arguments>node_modules
|
|
30
|
+
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
31
|
</matcher>
|
|
32
32
|
</filter>
|
|
33
33
|
</filteredResources>
|
|
@@ -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())
|
|
@@ -28,35 +28,37 @@ def safeExtGet(prop, fallback) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
apply plugin: 'com.android.library'
|
|
31
|
-
apply plugin: 'maven'
|
|
31
|
+
apply plugin: 'maven-publish'
|
|
32
32
|
|
|
33
33
|
buildscript {
|
|
34
34
|
// The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
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
|
}
|
|
48
50
|
|
|
49
51
|
apply plugin: 'com.android.library'
|
|
50
|
-
apply plugin: 'maven'
|
|
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
|
}
|
|
@@ -147,17 +150,24 @@ afterEvaluate { project ->
|
|
|
147
150
|
task androidJavadoc(type: Javadoc) {
|
|
148
151
|
source = android.sourceSets.main.java.srcDirs
|
|
149
152
|
classpath += files(android.bootClasspath)
|
|
150
|
-
classpath += files(project.getConfigurations().getByName('compile').asList())
|
|
153
|
+
// classpath += files(project.getConfigurations().getByName('compile').asList())
|
|
154
|
+
// subprojects { subproject ->
|
|
155
|
+
// if(project['name'] == 'react-native-risk-sdk'){
|
|
156
|
+
// project.configurations { compile { } }
|
|
157
|
+
// }
|
|
158
|
+
// }
|
|
159
|
+
project.getConfigurations().getByName('implementation').setCanBeResolved(true)
|
|
160
|
+
// classpath += files(project.getConfigurations().getByName('implementation').asList())
|
|
151
161
|
include '**/*.java'
|
|
152
162
|
}
|
|
153
163
|
|
|
154
164
|
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
|
155
|
-
|
|
165
|
+
archiveClassifier = 'javadoc'
|
|
156
166
|
from androidJavadoc.destinationDir
|
|
157
167
|
}
|
|
158
168
|
|
|
159
169
|
task androidSourcesJar(type: Jar) {
|
|
160
|
-
|
|
170
|
+
archiveClassifier = 'sources'
|
|
161
171
|
from android.sourceSets.main.java.srcDirs
|
|
162
172
|
include '**/*.java'
|
|
163
173
|
}
|
|
@@ -181,12 +191,11 @@ afterEvaluate { project ->
|
|
|
181
191
|
archives androidJavadocJar
|
|
182
192
|
}
|
|
183
193
|
|
|
184
|
-
task installArchives(type: Upload) {
|
|
185
|
-
configuration = configurations.archives
|
|
186
|
-
repositories.
|
|
187
|
-
// Deploy to react-native-event-bridge/maven, ready to publish to npm
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
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
|
+
// }
|
|
192
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,74 @@ 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
|
+
@ReactMethod
|
|
94
|
+
public void setDeviceMatch(@Nullable String email, @Nullable String name, @Nullable String phone) {
|
|
95
|
+
final DeviceMatch.Builder deviceMatchBuilder = new DeviceMatch.Builder();
|
|
96
|
+
if (email != null) {
|
|
97
|
+
deviceMatchBuilder.setEmail(email);
|
|
98
|
+
}
|
|
99
|
+
if (name != null) {
|
|
100
|
+
deviceMatchBuilder.setName(name);
|
|
101
|
+
}
|
|
102
|
+
if (phone != null) {
|
|
103
|
+
deviceMatchBuilder.setPhone(phone);
|
|
104
|
+
}
|
|
105
|
+
finbox.setDeviceMatch(deviceMatchBuilder.build());
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Forward the FCM notifications to SDK
|
|
110
|
+
*/
|
|
111
|
+
@ReactMethod
|
|
112
|
+
public void forwardFinBoxNotificationToSDK(@NonNull ReadableMap data) {
|
|
113
|
+
Map<String, String> dataMap = (Map) data.toHashMap();
|
|
114
|
+
if (MessagingService.forwardToFinBoxSDK(dataMap)) {
|
|
115
|
+
// FinBox Firebase Message
|
|
116
|
+
MessagingService firebaseMessagingService = new MessagingService(reactContext);
|
|
117
|
+
firebaseMessagingService.onMessageReceived(dataMap);
|
|
118
|
+
} else {
|
|
119
|
+
// Nothing to do
|
|
120
|
+
// Irrelevant to FinBox SDk
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Set the sync frequency
|
|
126
|
+
* @param duration Time to set the frequency
|
|
127
|
+
*/
|
|
128
|
+
@ReactMethod
|
|
129
|
+
public void setSyncFrequency(Integer duration) {
|
|
130
|
+
finbox.setSyncFrequency(duration);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Stop sending the data
|
|
135
|
+
*/
|
|
89
136
|
@ReactMethod
|
|
90
137
|
public void stopPeriodicSync() {
|
|
91
|
-
|
|
138
|
+
finbox.stopPeriodicSync();
|
|
92
139
|
}
|
|
93
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Delete the user information from the local device
|
|
143
|
+
*/
|
|
94
144
|
@ReactMethod
|
|
95
|
-
public void
|
|
145
|
+
public void resetData() {
|
|
96
146
|
FinBox.resetData();
|
|
97
147
|
}
|
|
98
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Delete the user information from the server
|
|
151
|
+
*/
|
|
152
|
+
@ReactMethod
|
|
153
|
+
public void forgetUser() {
|
|
154
|
+
FinBox.forgetUser();
|
|
155
|
+
}
|
|
156
|
+
|
|
99
157
|
}
|
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.20",
|
|
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
|
+
}
|
|
Binary file
|
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
|