Flutter KYC SDK
The Dojah platform has a smooth widget that enables your users to authorize access to their accounts. This widget works effortlessly across various browsers and devices of all sizes.
📘 Get Started with Flutter SDK - Dojah KYC Widget
Reference : flutter_dojah_kyc Pub Dev package
Example Application: https://github.com/dojah-inc/Flutter-SDK
Installation
Step 1 : Install flutter_dojah_kyc dependency in pubspec.yaml file of your flutter project
Usage
Step 2 : Create DojahKYC _dojahKYC class
Parameter | Type | Description |
---|---|---|
type | string | Widget Type: Values are ‘custom’, ‘verification’, ‘identification’, ‘verification’, ‘liveness’ |
app_id | string | Application Id, Get it from your dojah application dashboard here |
p_key | string | Public Key, Get it from your dojah application dashboard here |
reference_id | string | Reference ID, It can be passed to keep track of the verification steps (Started, Ongoing, Successful). NB: reference_id character length must be greater than 10 |
widget_id | string | Widget ID, Get it from your Easy Onboard application dashboard here |
user_data | object | Automatically update the user data page, and thus skip the page |
gov_data | object | Automatically update the government data page, and thus skip the page |
metadata | object | Your application’s metadata to be passed back to you via webhook, onSuccess, or onError |
onSuccess | function | This is called when your user has successfully completed enrollment with their preferred institution. The sample response data below is passed to the widget |
onError | function | This is called when your user was unable to successfully complete enrollment. |
onClose | function | This is called when the widget is closed. |
Other required installations (make sure to follow the instructions in the webview_screen documentation).
Kindly request camera permissions before launching the widget
📘 Request Camera Permission
Kindly declare and request camera permission in the main activity, at your application level - MainActivity/main.dart before launching the SDK
Android configuration
iOS configuration
Podfile
infoplist
Run your flutter Project
Step 3: Handle a Successful Enrollment
On successful enrollment, the _onSuccess _callback function that you supplied is called by the SDK. We then return the connected account code to your server.
Alternative configuration instead of Specifying pages Array from the SDK
The main advantage of this feature is to enable you make changes to your widget flow or configuration on Dojah Dashboard herehere instead of rebuilding or modifying the main Flutter Application.
Implementation Example
Kindly use the overall status (response.status (Boolean, i.e true or false)) to ascertain if the request failed or succeeded.
📘 Webhook Notifications
You can receive the same data below (also passed to onSuccess and onError) via a webhook call.
Register your url for webhook calls here and ensure
kyc.widget
is theservice
you are subscribed to.In Config object Kindly set webhook object value to true (Boolean)
Example : webhook : true
The Sample response data after successful verification
By Setting the user-data and country page config enable object to false, The user-data and country page will be removed. Kindly note that this customisation can be implemented only in custom widget type.
📘 How to Exclude or Skip the User data Page
Kindly pass userData inside the DojahKYC constructor class.
Example :
📘 How to retrieve the Selfie Photo
There’s a response object that is sent to the client via the widget launcher on success or failure
selfieUrl and idUrl under selfie and id in the success response objects, which holds the final selfie capture and id capture respectively.
📘 How to Fix Android File Upload Crash
Webview issues and fixes
- if you ever experienced “Unknown feature SUPPRESS_ERROR_PAGE, webview not displaying at all on Android device,
Add this to android/build.gradle
Add this to dependency file
Issue on Github
Deployment
REMEMBER TO CHANGE THE APP ID and PUBLIC KEY WHEN DEPLOYING TO A LIVE (PRODUCTION) ENVIRONMENT
https://github.com/dojah-inc/Flutter-SDK
Example Application : https://github.com/dojah-inc/Flutter-SDK/tree/master/examples
- Fork it!
- Create your feature branch: git checkout -b feature/feature-name
- Commit your changes: git commit -am ‘Some commit message’
- Push to the branch: git push origin feature/feature-name
- Submit a pull request 😉😉
This project is licensed under the MIT License - see the LICENSE file for details
Was this page helpful?