Skip to main content

videokyc_flutter 1.7.0 copy "videokyc_flutter: ^1.7.0" to clipboard
videokyc_flutter: ^1.7.0 copied to clipboard

A Flutter SDK for integrating SurePass Video KYC verification.

1.7.0 #

  • A verification the user leaves unfinished can now be continued. Leaving the verification page with the back arrow or Android's back button, and confirming, used to mean starting again: the next startSurepassVideoKyc call always created a new session, and the user went back to the first step. The SDK now keeps the session. On the next call with the same values, it asks SurePass whether that session is still open, and if it is, asks the user to Continue or Start over. Continue reopens the same session on the same URL, with the page's web storage as the user left it, and creates nothing new. Start over creates a new session, as every call did before.
  • The same values means the same env, workflowId, email, fullName, mobileNumber, userImage and advanceParameters. The token isn't compared, so a refreshed token still finds the session. A call that differs in anything else starts a new session without asking, because the kept session was created without that difference and would ignore it.
  • The session is kept in memory for as long as the app's process runs, and nothing is written to the device. Only the session the user last left is kept. A call that ends any other way (completed, failed or an error) leaves nothing to continue, and neither does a session SurePass reports as no longer open. If SurePass can't be reached to check, the user isn't asked and a new session is created. Closing the question with the back button returns VideoKycStatus.cancelled and keeps the session for the next call.
  • onInitialized is called again when a session is continued, with that session's details, so it still fires once for every call that reaches the verification page.
  • The cancel confirmation no longer tells the user they'll need to start over. It says they can pick up where they left off.
  • Cancelling on the setup screen just as the session finished being created no longer opens the verification page, or calls onInitialized, after the host app has already received VideoKycStatus.cancelled.
  • On Android, a photo taken with the camera now reaches the verification page. When the page asked for a file, Android offered the camera next to the file picker, and choosing it opened the camera and took the photo, but the page never received it. flutter_inappwebview, which runs the page, gives the camera a file to save the photo into through a FileProvider, and it expects the app to declare that provider. Nothing declared it. With nowhere to save, the camera returned no photo, and the page saw what it sees when the user cancels: no file and no error. The file picker was not affected, and neither was iOS.
  • The SDK now declares that provider itself, so integrators have nothing to add. It ships an Android module whose manifest merges into your app's when you build. The module holds only that declaration, a copy of the paths file it points at, and an empty plugin class, which is what makes Flutter build it in. It adds no dependencies and nothing to iOS builds.
  • If your app already declares InAppWebViewFileProvider itself, remove that declaration or make it match the SDK's exactly. A declaration that differs fails the manifest merge, and the error names the attribute that differs. If your app has its own res/xml/provider_paths.xml, Android uses it in place of the SDK's, so it must include <external-path name="external_files" path="." />.
  • pub.dev now lists the SDK for both Android and iOS. A Flutter plugin's platforms are taken from its plugin declarations, and the Android module above makes the SDK a plugin that declares only Android. The pubspec now names both platforms explicitly, which pub.dev uses instead.
  • The README's iOS setup now covers Xcode 27, which builds only for iOS 15.0 and later. Setting 15.0 in the Podfile alone left the app target at the 13.0 Flutter's template sets, and the build failed. The README now also has you set the Runner target's minimum deployment to 15.0, and its Podfile snippet raises every pod to 15.0, the Flutter pod included. It also says when the Podfile's PERMISSION_* lines are needed: only when permission_handler is built with CocoaPods. Built as a Swift package, it switches the permissions on from the Info.plist keys.

1.6.0 #

  • New optional advanceParameters on startSurepassVideoKyc, taking a VideoKycAdvanceParameters: the verification thresholds for PAN, Voter ID, Aadhaar and driving licence, sixteen in all, each a whole number (int). They are sent in the initiate-video-kyc request's advance_parameters object, each under its snake_case API key (panLivenessThreshold goes out as pan_liveness_threshold), next to the user_image the SDK already puts there when userImage is passed.
  • Only the thresholds you set are sent, exactly as given; the SDK does not check their range. With no image and no thresholds, advance_parameters is still left out of the request entirely, so existing integrations send exactly what they did before.
  • VideoKycAdvanceParameters.fromJson reads the thresholds from a map shaped like advance_parameters, for a host app that already holds them as JSON.
  • The example app now passes a full set of thresholds.

1.5.3 #

  • "Location is off" now takes the user to the setting that fixes it. The dialog, shown when the device's own location switch is off, offered only Try again, so the user had to find that switch on their own — and the app's settings page, where "Permission blocked" sends them, has no switch for it: it holds the app's permissions, not the device's. Open settings replaces Try again there. On Android it opens the device's location settings screen, falling back to the app's page only if that screen cannot be opened; on iOS it opens the app's page in Settings, the only one iOS lets an app open. When the user comes back, the SDK checks again, exactly as it does after the settings trip for a blocked permission.
  • New dependency: android_intent_plus, to open Android's location settings screen. It is Android-only, so nothing is added to iOS builds, and it builds alongside the flutter_inappwebview 6.2.0-beta.3 override the README documents for Android Gradle Plugin 9.

1.5.2 #

  • The verification page's location check no longer spins forever when the device's location is switched off. The SDK only checked the location permission, which the app can hold while the device-wide setting is off, and in that state Android's WebView answers the page's location request with neither a position nor an error. The setting is now checked as part of the permission step, before the session is created: if it is off, a "Location is off" dialog asks the user to turn it on, and Try again checks again. Cancelling ends the flow with VideoKycStatus.error and the errorMessage Location is turned off on this device. A setting that cannot be read doesn't stop the flow, and the check confirms only that the setting is on, not that a location can actually be found.
  • On iOS, Location Services being switched off is now reported as exactly that. iOS presents it as a denied location permission, so the SDK showed "Permission blocked" and sent the user to the app's settings page, which has no switch for it. A build that left location out of its Podfile, which the plugin also reports as a denial, still gets the permission dialog, not this one.
  • Android now requires precise location. A user who allowed only approximate location was stuck: the dialog asked for "location", which they had already granted, and Try again looped. The dialog now asks for precise location by name. iOS is unchanged, since the permission plugin has no way to tell whether Precise Location is on.
  • The permission dialog no longer shows raw plugin names or repeats itself. Alongside the permissions asked for, Android's plugin reports sibling ones, and the SDK listed those too: "Video KYC needs location, microphone, location and permission.speech to verify you." Only the permissions the SDK asks for are judged now.
  • Every permission that isn't granted is requested, including one that already reads as permanently denied, rather than only those reading plain denied. On Android "permanently denied" is the plugin's guess, made from a flag it stores and never clears, so a stale guess skipped a prompt the OS would still have shown. The OS prompts only for what it still can, so nothing is lost. Coming back from the settings page asks again the same way, instead of only re-reading the statuses.
  • The permission step can no longer leave the setup screen spinning forever. A permission request that fails — two requests at once is the usual cause — now ends the flow with VideoKycStatus.error and an errorMessage starting Could not request permissions:. An answer the plugin loses outright is recovered too: on Android a request that overlaps another can be dropped without any reply, so once the app has sat in the foreground for 3 seconds with no system prompt showing and no answer, the SDK reads the permission statuses directly.
  • The verification page's own permission requests are answered one at a time. The page asks for the camera, microphone and location together, and a request refused for overlapping another reached the page as a silent denial. Resources are now matched by type rather than by substrings of their names, and the logic moved out of the WebView page's build method into the permission module the setup step uses.
  • Location is requested as Permission.locationWhenInUse on both platforms. On iOS it behaves exactly as Permission.location did, so the Podfile's PERMISSION_LOCATION=1 still covers it.

1.5.1 #

  • Scrolling the verification page no longer reloads it. Pull-to-refresh asked only whether the finger had travelled 96px downward and whether the WebView's own scroll position read zero at that instant — never where the content was when the gesture began. A page laid out to fill the viewport keeps that position pinned at zero however far its content is scrolled, so ordinary downward swipes qualified; so did any swipe that reached the top of the page partway through.
  • A refresh now has to be asked for deliberately. The content under the finger must be at its top when the touch lands — a question put to the page itself, so content scrolled inside an inner container counts — and the drag must then run 70% of the page's height, well past anything an ordinary scroll produces. The check runs again at the moment it fires, so a gesture that scrolled up first and only then totalled a downward drag doesn't qualify.
  • The platform's own pull-to-refresh no longer intercepts gestures. It decides from the same misleading scroll position, and at its own far shorter trigger distance (~64dp on Android, a system-fixed distance on iOS, neither adjustable), so it would have overridden the rule above. It is now attached only to draw the spinner for a refresh the SDK has decided on.
  • Pull-to-refresh does not fire while the finger is over an <iframe>. A frame's scroll position cannot be read from the page around it — cross-origin it never can be — so a pull there is indistinguishable from a scroll.

1.5.0 #

  • The verification page no longer runs to the top of the screen. A strip sits above it, and the button that used to float over the page in the corner now lives at that strip's leading edge.
  • That button is a back arrow rather than an X, on both platforms — Icons.adaptive.arrow_back, so it is Material's arrow on Android and the chevron on iOS. What it does is unchanged: it still asks the cancel confirmation and still returns VideoKycStatus.cancelled.

1.4.0 #

  • The SDK no longer writes anything to the console. VkycLog and all 33 of its call sites are gone, along with the debug-only Dio interceptor that traced every request and response. Nothing changes for release builds — the logging was already compiled out of them — but debug builds are now silent too, so the [VideoKYC] lines no longer sit in your console next to your own. Attaching a debugger to the verification page still works: chrome://inspect on Android and Safari's Web Inspector on iOS are untouched.
  • The floating close button over the verification page is no longer iOS-only — Android shows the same X, in the same place, asking the same cancel confirmation. Android's system back button still works; the button just makes leaving the flow visible, which a full-screen web page otherwise gives no hint of.

1.3.0 #

  • Completion is now read from the server instead of overheard from the page. The SDK polls the workflow session API for current_status every 3 seconds and ends the flow on COMPLETED, FAILED, or CANCELED. The injected WebSocket listener that watched for the page's own Socket.IO TERMINATE frame is gone.
  • This fixes a class of flows that never ended. The old listener could only catch the event as it went past, so it was lost whenever the page reloaded (including via the SDK's own pull-to-refresh), whenever the app was backgrounded, and on any network that blocks the WebSocket upgrade and leaves Socket.IO on HTTP long-polling. Reading session state has none of those failure modes.
  • VideoKycStatus.failed is now emitted, and is no longer reserved. A session the server reports as FAILED returns it, with the server's error_safe_description and error_code as the errorMessage — previously every failure was indistinguishable from a success, because the old listener treated any termination as one.
  • A server-side CANCELED now returns VideoKycStatus.cancelled, matching what the user did rather than reporting it as a success.
  • Polling pauses while the host app is in the background and reads again immediately on resume. Single failed reads are retried with backoff; the flow only ends with VideoKycStatus.error after several consecutive failures, or after 20 minutes without a terminal status.
  • redirectUrl is now optional on the initiate-video-kyc request and is omitted from the payload entirely when not supplied, rather than being sent as null. It was only ever there to carry the completion redirect the SDK no longer depends on.
  • workflowSessionId moved from VideoKycModel up to VideoKycEntity. VideoKycModel exposes it exactly as before, so onInitialized callers are unaffected.
  • The finalizing screen shown while control returns to the host app now plays the SDK's loader animation (a new lottie dependency, with the fill retinted to the host theme) and holds for a randomized 3–6.7 seconds instead of a fixed 3.
  • The SDK no longer draws its own top bar and back arrow — the flow fills the screen, padded off the status bar and the system navigation bar, with status-bar icon contrast matched to the theme. The flow is left via the system back gesture/button (Android), still guarded by the cancel-confirmation dialog.
  • iOS gets a floating close button over the verification page — iOS has no system back button, and the SDK blocks the swipe-back gesture by design, so without it the flow could not be left at all. It asks the same cancel confirmation as Android's back gesture.
  • Fixed a race between the cancel dialog and the flow finishing: if the session reached its outcome while "Cancel verification?" was on screen, the SDK could report cancelled for a session the server completed — or crash by delivering the result to the dialog's route instead of the page's. The real outcome now dismisses the dialog and wins, dialogs no longer stack on repeated back presses, and every exit path goes through one guarded pop.
  • A dead WebView process (render process on Android, web content process on iOS — realistic under memory pressure with a camera running) no longer leaves a frozen white screen until the polling deadline: the SDK rebuilds the WebView once on the signed URL — the server-side session is unaffected — and only a second death ends the flow, as an error.
  • The polling deadline is now measured on the wall clock, so time spent inside slow requests counts and a degraded network can no longer stretch the 20-minute ceiling into hours. Transient-failure tolerance was widened from ~45 seconds to over two minutes of backed-off retries — enough to ride out a WiFi-to-cellular handover mid-call.

1.2.1 #

  • A denied permission is now recoverable instead of ending the flow on the spot. The SDK distinguishes a denial the OS will still prompt for from a permanent one (Android "Don't ask again" / a second denial; on iOS a single denial) and from a policy-restricted one, and shows a dialog matched to each: Try Again re-triggers the system prompt, Open Settings sends the user to the app's settings page and re-checks the permissions when they come back, and a restricted permission is explained rather than offered a dead-end action. Previously a permanently denied permission made every later attempt fail instantly with nothing on screen explaining why.
  • Cancelling that dialog still ends the flow with VideoKycStatus.error, now carrying an errorMessage that names the permissions that were not granted.
  • API errors no longer depend on the server answering with JSON. The error body was indexed with ['message'] regardless of its type, so a proxy or gateway returning HTML or plain text threw instead of reporting the real failure; the message is now extracted safely, shared by both endpoints, and clamped so a whole error page can't become the errorMessage.
  • Trimmed the README for pub.dev and tightened ApiClient internals. No public API changes.
  • The SDK's screens and dialogs were redesigned to sit inside your app rather than beside it. Gone: the gradient finishing screen with its animated ring-and-icon, the tinted status boxes, the loading percentage, and the hardcoded blue that ignored your theme. Colours and type now come from the host app's Theme, so the flow follows your app — including dark mode, which the old fixed palette broke. The WebView's load state is a hairline bar at the top of the page instead of a centred spinner over a blank screen, and dialog actions are plain text buttons with real verbs instead of Yes/No.
  • StatusDialog keeps its exact API but changes its wording and appearance. If you call it directly, expect new copy — "Verification complete" rather than "Success".
  • The cancel confirmation was duplicated across both pages; it is one widget now, so the two can no longer drift apart.

1.2.0 #

  • email, fullName, and mobileNumber on startSurepassVideoKyc() are now optional. Values you pass are still trimmed and sent as-is; for any you omit — or pass as an empty/whitespace-only string — the SDK substitutes a placeholder on the create-user request (vkyc.user@example.com, vkyc user, 1234567890), since the API requires all three. Existing calls that pass all three behave exactly as before. Note that sessions relying on the defaults produce KYC records carrying placeholder identity data rather than the customer's own.
  • The create-user response parser no longer assumes email / full_name / user_mobile_number come back, so a response that omits them is parsed instead of failing.

1.1.1 #

  • The WebView now starts each verification from a clean session. Before the flow opens, the SDK clears all WebView cookies and HTML5 storage (localStorage / sessionStorage), so a stale or expired session left over from a previous attempt can't resume a dead flow. Note: cookie clearing empties the shared WebView cookie jar, so any other WebViews in the host app are cleared too. Clearing is best-effort — a failure is logged in debug builds and never blocks the flow.

1.1.0 #

  • Added an optional userImage parameter to startSurepassVideoKyc(). When provided, the raw image bytes are base64-encoded and sent as advance_parameters.user_image on the initiate-video-kyc request; when omitted, advance_parameters is left off the request entirely. The example/ app now demonstrates picking a selfie (via image_picker) and passing it in.
  • Centralized all SDK logging behind a new debug-only VkycLog helper — every call is gated by kDebugMode, so the SDK stays silent in a host app's release builds.
  • Added debug-only network logging (request / response / error) to the API client. It redacts the Authorization bearer token and truncates long values (such as the base64 user_image selfie) so secrets and large payloads never reach the console.

1.0.3 #

  • Flow completion is now detected from the server's authoritative Socket.IO TERMINATE event (via an injected WebSocket listener) instead of watching for a URL redirect — more reliable, and the completion page no longer briefly flashes in the WebView.
  • Added a branded finalizing loader, shown briefly before control returns to the host app.
  • Hardened teardown: guarded the pull-to-refresh controller against double-dispose, and trailing WebView navigations/errors after completion are ignored so they can't crash the flow or override the result.

1.0.2 #

  • Documented the required MODIFY_AUDIO_SETTINGS Android permission — needed for microphone capture inside the verification WebView.
  • Documented the mandatory permission_handler iOS Podfile macros (PERMISSION_CAMERA / PERMISSION_MICROPHONE / PERMISSION_LOCATION); without them the iOS permission prompts never appear and the flow ends in error.
  • Raised the minimum to Flutter 3.24 / Dart 3.5 to match the flutter_inappwebview and permission_handler requirements.
  • README corrections: VideoKycStatus.failed is reserved (not currently emitted), a valid 10-digit mobileNumber example, and accurate errorMessage nullability.
  • No longer logs signed verification URLs in release builds.
  • Added an example/ app.
  • Documented an Android Gradle Plugin 9 build workaround — an app-level dependency_overrides to the flutter_inappwebview 6.2.0 prerelease, until it ships stable.

1.0.1 #

  • Initial release of the SurePass Video KYC Flutter SDK.
  • startSurepassVideoKyc() runs the full WebView-based Video KYC flow and returns a typed SurepassVideoKycResult (success / cancelled / failed / error) along with the session id.
  • Automatic camera, microphone, and location permission handling on Android (API 28+) and iOS (15.0+).
  • Sandbox and production environments selectable via Env.
  • Optional onInitialized callback exposing VideoKycModel session data as soon as the session is created.