0Bit Documentation

Mobile WebViews

Open hosted 0Gate flows from native iOS or Android containers without moving secret-key work into the app.

Mobile apps should keep the same trust model as web integrations: the native app asks your backend for a session, receives only browser-safe values, opens a hosted 0Gate surface, and waits for your backend to confirm the signed event.

Use a secure browser surface or hosted WebView that can complete the 0Gate page, then return through an HTTPS universal link or app link. Your app should query your backend for the final order state after return instead of trusting the return URL alone.

Implementation checklist

AreaRequirement
Session creationServer-side only, with sk_*, idempotency, and your order reference.
Mobile launchOpen hosted redirect with pk_* and client_secret, not a secret key.
Return URLUse HTTPS universal links or app links where possible.
App resumeShow pending while your backend waits for the verified webhook.
WebView storageAvoid persisting secrets, identity data, or raw hosted payloads in mobile logs.
RetryCreate a new session for a new attempt after expiry, cancellation, or stale state.

Mobile states

App stateMeaning
opening_hosted_flowThe app has received client_secret and is opening the hosted page.
waiting_for_userThe user is inside the hosted surface.
returned_to_appThe hosted surface navigated back to your HTTPS return URL.
pending_backend_eventThe app is waiting for your backend state after webhook processing.
completedYour backend verified a terminal event and updated durable state.
failed_or_cancelledYour backend recorded a failed, expired, or cancelled attempt.

Do not put sk_* in mobile apps

Native apps can be inspected. Keep all secret-key operations behind your backend, even when the UX feels like an app-only flow.

On this page