React Native
Device Connect React Native SDK is used to collect anonymised non-PII data from the devices of the users after taking explicit user consent.
#
InstallationUsing yarn:
or using npm:
Our SDK will auto link automatically with your application
#
AuthenticationOpen Android Studio and in the project level build.gradle
file, add the repository URLs to all allprojects
block.
Add the following keys in local.properties
file:
NOTE
Following will be shared by FinBox team at the time of integration:
ACCESS_KEY
SECRET_KEY
DC_SDK_VERSION
COMMON_SDK_VERSION
COMMON_FLAVOR
LOGGER_SDK_VERSION
CLIENT_API_KEY
#
Create User MethodCall createUser
method using the FinBoxRiskSdk
instance to create the user (first time) or check the API credentials for the SDK. It takes CUSTOMER_ID
as one of its arguments which is a unique identifier for a user.
IMPORTANT
Please make sure CUSTOMER_ID
is not more than 64 characters and is alphanumeric (with no special characters). Also it should never null
or a blank string ""
.
The response to this method (success or failure) can be captured using the callback, and on success Start Periodic Sync Method should be called.
Read about the error codes in this section.
#
Start Periodic Sync MethodThis is to be called only on a successful response to createUser
method's callback. On calling this the syncs will start for all the data sources configured as per permissions. The method below syncs data in the background at regular intervals:
Handle Sync Frequency
startPeriodicSync
takes one argument which indicates the frequency of sync in hours.
#
Cancel Periodic SyncingIf you have already set up the sync for the user data, you can cancel it any time by the following code:
#
Reset User DataIn case the user data needs to be removed to re-sync the entire data, use the method resetData
.