Skip to main content

Integration

This section covers the fundamental setup and configuration required to integrate the SDK into your application. It includes the code needed to initialize and utilize the core functionalities provided by the SDK.

Base Usage

This involves wrapping your MaterialApp widget with EztoVerifyApp and configuring various callbacks and settings to manage permissions, errors, and transactions within your Flutter app.

EztoVerifyApp(
forceUpdate: const ForceUpdate(
android: UpgradeConfig(shouldForceUpdate: true),
ios: UpgradeConfig(shouldForceUpdate: true)
// App force update need call this
),
onPermissionDenied: (deniedPermission) async {
// Handle permission denial
return true;
},
onResult: (String reqId, String authReqId) async {
// Handle successful authentication result
},
onPushTokenRequest: () async {
return GetTokenModel(
// Provide FCM token
pushToken: "token",
pushType: PushSupport.firebase,
);
},
onError: (reason) {
// Handle SDK error
},
onClose: (reason) {
// Handle transaction closure
},
onTransactionRequest: (data, isFromDeeplink) async {
// For deeplinks
EztoVerify(
encryptionKey: key,
).onPushReceived(
data: data);
},
child: MaterialApp(
// ... Your app configuration
),
);

Callback Functions

  • forceUpdate - If given true, the respective app will check for available update and force update will be initiated.
  • onPermissionDenied - Called when the user denies runtime permission. Return true if all requested permissions are granted, else return false.
  • onResult - Called if the Result Hook notification way in Ezto dashboard is set to Mobile_Sdk. Only called if the authentication flow is completed successfully.
  • onPushTokenRequest - SDK has requested the token and push type. App should get the token, push type and return it.
  • onError - Called when the SDK encounters an error.
  • onClose - Called when the transaction has completed.
  • onTransactionRequest - This function is called to get the payload data.

Push Support

This functionality enables an application to handle and process push notifications. It includes setting up the necessary configurations and methods to receive, decrypt, and respond to push messages sent to the app.

ezto verify's SDK push support involves using the onPushReceived method on the EztoVerify instance to handle incoming push notifications securely with the provided encryption key. To get the encryption key, check here.

 FirebaseMessaging.onMessageOpenedApp.listen((message) async {
EztoVerify(
encryptionKey: {{encryption key}}, // replace this
).onPushReceived(
data: message.data,
);
});

QR Support

This functionality allows an application to scan and process QR codes. It involves setting up the necessary configurations and methods to read QR codes and perform actions based on the data contained within them.

ezto verify's SDK QR support involves using the scanQr method on the EztoVerify instance to enable secure QR code scanning within your app, utilizing the provided encryption key for secure processing.

To launch the QR scanner, use the below code. To get the encryption key, check here.

EztoVerify(
encryptionKey: {{encryption key}},
).scanQr();