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

A Flutter SDK for integrating SurePass Video KYC verification.

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.flutter-io.cn 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.