finbox_dc_plugin 1.0.0
finbox_dc_plugin: ^1.0.0 copied to clipboard

Device Connect Flutter SDK is used to collect anonymised non-PII data from the devices of the users after taking explicit user consent

Flutter DeviceConnect #

The plugin can be used to integrate mobile apps with DeviceConnect so that users can share their data.

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

Add Plugin #

Specify the following in local.properties file:

ACCESS_KEY=<ACCESS_KEY>
SECRET_KEY=<SECRET_KEY>
DC_SDK_VERSION=<RM_SDK_VERSION>
COMMON_SDK_VERSION=<COMMON_SDK_VERSION>
COMMON_FLAVOR=<COMMON_FLAVOR>
LOGGER_SDK_VERSION=<LOGGER_SDK_VERSION>

Add plugin dependency in pubspec.yaml file:

 finbox_dc_plugin: any

Create User #

Call FinBoxDcPlugin.createUser(<CLIENT_API_KEY>, <CUSTOMER_ID>) to share users data.

FinBoxDcPlugin.createUser("CLIENT_API_KEY", "CUSTOMER_ID").fold(
(right) => {
// Authentication is success
print("Access Token: $right")
},
(left) => {
// Authentication failed
print("Error Code $left")
});

You can read about the errors in the Error Codes section.

Start Periodic Sync #

This 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.

FinBoxDcPlugin.startPeriodicSync();

Error Codes #

Below table contains the constant name, error code value and the description of error code:

::: tip TIP All the constants stated below are available as constants in SDK. :::

Constant NameConstant ValueDescription
QUOTA_LIMIT_EXCEEDED7670API Key exceeded its quota limit
AUTHENTICATE_FAILED7671Authentication of the API Key and the User failed
AUTHENTICATE_API_FAILED7672Authentication of the API Key failed
AUTHORIZATION_API_FAILED7673Authorization of the API Key failed
AUTHENTICATE_API_EMPTY7676API key is empty
AUTHENTICATE_USER_EMPTY7677User name is empty
NO_ACTIVE_NETWORK7678Device is not connected to an active network
NETWORK_TIME_OUT7679Request timed out
NETWORK_RESPONSE_NULL7681Network response is null
USER_TOKENS_NULL7682Both access token and refresh token is null
ACCESS_TOKEN_NULL7683Access token is null
REFRESH_TOKEN_NULL7684Refresh token is null
AUTHENTICATE_NOT_FOUND7685End point is not found

Some error codes can be resolved by validating the implementation and some by retrying the creation of the user, while other error codes can only be resolved by contacting FinBox.

0
likes
60
pub points
28%
popularity

Device Connect Flutter SDK is used to collect anonymised non-PII data from the devices of the users after taking explicit user consent

Repository (missing)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

either_dart, firebase_analytics, firebase_core, firebase_messaging, flutter

More

Packages that depend on finbox_dc_plugin