Android Client
FinBox Lending SDK is a drop-in module that can add a digital lending journey to any mobile application.
#
RequirementsFinBox Lending SDK works on Android 5.0+ (API level 21+), Java 8+ and AndroidX. In addition to the changes, enable desugaring to support older versions.
- Kotlin
- Groovy
#
Adding DependencyAdd the repository url to allprojects
in the project build.gradle
file.
- Kotlin
- Groovy
Add the Lending SDK dependency to the module build.gradle
file
- Kotlin
- Groovy
Note
Find a full list of keys required to integrate on mobile here
#
PermissionsLending SDK requires SMS
and Location
permission as mandatory. Make sure you dont have any node markers that remove these permissions in your manifest file
Manifest should not have any of the following
ProGuard
While generating a signed application, make sure ProGuard file uses proguard-android.txt
not proguard-android-optimize.txt
, i.e. make sure it is:
- Kotlin
- Groovy
#
Start SDK flowOnce all dependencies are added, SDK requires 3 inputs: CUSTOMER_ID
, USER_TOKEN
and CLIENT_API_KEY
.
ENVIRONMENT
is an optional field. Default value of environment is PROD
.
Note
USER_TOKEN
needs to be generated against a CUSTOMER_ID
on backend before starting the SDK. Refer here
ENVIRONMENT
needs to be updated to PROD
when migrating application to production.
In the onCreate
of your application class initialize dependencies required by the SDK:
- Kotlin
- Java
Now that all required parameters are available, we can start the SDK flow as follows:
- Kotlin
- Java
setSplashIcon
is the optional method that will contain the drawable (in Int) that can be used to show icon on the splash screen.setToolbarIcon
is the optional method that will contain the drawable (in Int) that can be used to show the icon on the toolbar.
#
Credit LineFor credit line journey, include the following dependency in the module build.gradle
file:
- Kotlin
- Groovy
In case of credit line product, once the lending journey is completed, user can opt-in for a credit while doing a transaction. For such a case use following method to start the credit line withdrawl journey:
- Kotlin
- Java
setCreditLineAmount
is the method that will contain the amount (in Float) that a user is trying to withdrawsetCreditLineTransactionId
will hold the transaction id (in String) for the withdrawal flow
#
CallbackThe callback will be provided when the user exits the SDK. You can track the status of user exit actions in the onActivityResult
callback function
- Kotlin
- Java
FinBoxJourneyResult has the following values:
resultCode
: Status code for the journey.screen
: Name of the last screen in the journeymessage
: Any additional message to describe the resultCode
Possible values for resultCode
are as follows:
Result Code | Description |
---|---|
MW200 | Journey is completed successfully |
MW500 | User exits the journey |
MW400 | Some error occurred in the SDK |
CL200 | Credit line withdrawal success |
CL500 | Credit line withdrawal failed |
Possible values for screen
are as follows:
Screen | Description |
---|---|
Launcher | The base screen (Hidden Activity) |
Permissions | Permission list screen |
Profile | Basic profile screen |
PAN Consent | PAN consent screen |
Dashboard | Dashboard screen |
Loan Form | Loan application screen |
KYC | KYC screen |
Bank Verification | Bank verification screen |
Loan Offer | Loan details screen |
Sign Agreement | Sign agreement screen |
#
NotificationsFinBox Lending SDK sends notifications of its own for mandatory events. It is expected that the client app has Firebase configured and can forward the notification payload to the SDK. In order for SDK to capture the notifications add the following:
- implement
FinBoxLendingMessagingImpl
interface - Override
getLendingIntent
&getRepayLendingIntent
to provide intent to open the SDK - initialize the lending messaging service
forwardToFinBoxLendingSDK
will check if the notification payload was triggered by FinBox lending teambuildLendingNotification
will build the notification and show it to the user
- Kotlin
- Java
- The privacy policy URL needs to be updated to the company policy. The default privacy policy is pointing to FinBox privacy. Add a String resource to specify the policy URL.
Note
Make sure the value passed is a valid URL
- The toolbar title can be updated which will be visible in the Dashboard module. In order to update the toolbar just add a String resource for the same.
- SDK fonts can be customised to match the parent application. The SDK used 3 main fonts as mentioned below:
FBLendingAppTheme.FinBox.TextPrimary
is used for all buttons and bold headersFBLendingAppTheme.FinBox.TextSecondary
is the regular font that is used for regular textFBLendingAppTheme.FinBox.TextSubHead
is the medium bold font that is used for Sections or subheadings
Customize the SDK font by adding the application fontFamily
in the styles.
- SDK Buttons can be customized by overriding
FBLendingAppTheme
Change button corner radius and text font as per your application theme.