{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/product/embedded-flows/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["example-box"]},"type":"markdown"},"seo":{"title":"Embed on Android","siteUrl":"https://docs.wise.com","projectTitle":"Wise Platform","description":"Embed a Wise Platform Embedded Flow in an Android app."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"embed-on-android","__idx":0},"children":["Embed on Android"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this guide after your backend has created an Embedded Flow URL with the create recipient embedded link request endpoint."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On Android, load the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," in a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WebView"]},". If you want to react to flow events in native code, inject a small bridge that forwards window messages from the flow to your app."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"load-the-flow","__idx":1},"children":["Load the flow"]},{"$$mdtype":"Tag","name":"ExampleBox","attributes":{"title":"WebView setup","type":"code"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"val webView: WebView = findViewById(R.id.wiseEmbeddedFlow)\n\nwebView.settings.javaScriptEnabled = true\nwebView.settings.domStorageEnabled = true\nwebView.loadUrl(\"<EMBEDDED_FLOW_URL>\")\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Some flows may need camera or microphone permissions for verification steps. Make sure your app handles Android runtime permissions when using flows that need device capabilities."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"optional-flow-messages","__idx":2},"children":["Optional flow messages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Embedded Flows can emit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ready"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resize"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["done"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," messages. In a native WebView, forward those messages to Kotlin with a JavaScript interface. If the user cancels the flow, Wise emits an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," message with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cancelled"]},"."]},{"$$mdtype":"Tag","name":"ExampleBox","attributes":{"title":"Bridge flow messages","type":"code"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import android.webkit.JavascriptInterface\nimport android.webkit.WebView\nimport android.webkit.WebViewClient\nimport org.json.JSONObject\n\nclass FlowBridge {\n  @JavascriptInterface\n  fun postMessage(payload: String) {\n    val event = JSONObject(payload)\n\n    when (event.optString(\"type\")) {\n      \"ready\" -> {\n        // Hide loading UI.\n      }\n      \"resize\" -> {\n        // Read event.optInt(\"height\") if you need to resize the WebView.\n      }\n      \"done\" -> {\n        // Continue your app flow.\n      }\n      \"error\" -> {\n        if (event.optString(\"code\") == \"cancelled\") {\n          // The user closed or cancelled the flow.\n          return\n        }\n\n        // Show a fallback state.\n      }\n    }\n  }\n}\n\nval webView: WebView = findViewById(R.id.wiseEmbeddedFlow)\n\nwebView.settings.javaScriptEnabled = true\nwebView.settings.domStorageEnabled = true\nwebView.addJavascriptInterface(FlowBridge(), \"WiseFlow\")\n\nwebView.webViewClient = object : WebViewClient() {\n  override fun onPageFinished(view: WebView, url: String) {\n    view.evaluateJavascript(\n      \"\"\"\n      window.addEventListener('message', function(event) {\n        window.WiseFlow.postMessage(JSON.stringify(event.data));\n      });\n      \"\"\".trimIndent(),\n      null\n    )\n  }\n}\n\nwebView.loadUrl(\"<EMBEDDED_FLOW_URL>\")\n","lang":"kotlin"},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"redirect-instead-of-embedding","__idx":3},"children":["Redirect instead of embedding"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a WebView is not the right fit for your app, open the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," with the browser component you normally use for external flows. When the flow finishes, Wise returns the user to the redirect URL you provided when creating the embedded link request."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wise appends ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=success"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=cancelled"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status=error"]}," when returning the user to your redirect URL."]}]},"headings":[{"value":"Embed on Android","id":"embed-on-android","depth":1},{"value":"Load the flow","id":"load-the-flow","depth":2},{"value":"Optional flow messages","id":"optional-flow-messages","depth":2},{"value":"Redirect instead of embedding","id":"redirect-instead-of-embedding","depth":2}],"frontmatter":{"seo":{"description":"Embed a Wise Platform Embedded Flow in an Android app.","title":"Embed on Android"},"markdown":{"lastUpdatedBlock":{"hide":true}}},"lastModified":"2026-06-29T11:35:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/product/embedded-flows/android","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}