This is an enterprise-only feature. Please contact us to enable.
- Basic — present the hosted page in a Chrome Custom Tab. One Kotlin file to copy.
- Headless — render your own native wallet list, driven by a hidden
WebView. Your app links no wallet SDK.
Basic
The integration is one Kotlin file,FireblocksConnect.kt — the Android analog of iOS’s FireblocksConnectFlow. It includes FireblocksRedirectActivity, the activity that catches the return.
1. Add the dependency and return activity
Add Chrome Custom Tabs to your Gradle build.build.gradle.kts
FireblocksRedirectActivity in AndroidManifest.xml (replace myapp with your scheme) so the OS routes the return to your app. singleTask lets the return dismiss the Custom Tab.
AndroidManifest.xml
2. Present the flow
CallFireblocksConnect.present. It appends redirect_uri, a random nonce, and embedded=1, verifies the returned nonce, and parses the result into WalletConnection.
MainActivity.kt
WalletConnection carries address, chain (evm or solana), walletName, and walletImage. Render walletImage in a WebView <img> — it’s an SVG sprite that ImageView can’t draw.
Headless
Render your own native list with no visible web.FireblocksHeadlessConnect runs the connect logic in a hidden WebView and talks to it over a bridge — the same architecture as iOS.
No SDK in your app. Your app links no wallet SDK. It needs a hidden
WebView pointed at the hosted engine page (https://your-connect-page.example/headless.html, set as ENGINE_URL in FireblocksHeadlessConnect) and your URL scheme. All the WalletConnect / MetaMask / Phantom logic — and the wallet list — comes from that hosted view.FireblocksHeadlessConnect.kt in addition to FireblocksConnect.kt (the visible fallback).
1. Get the wallet menu
The engine derives the list live from the Dynamic catalog and pushes it over the bridge (awallets message) — set FireblocksHeadlessConnect.onWallets. Each entry carries key, name, icon, chains (evm / solana), mode (headless | fallback), and featured.
2. Drop in FireblocksHeadlessConnect
It owns a hiddenWebView, bridges to it (addJavascriptInterface + evaluateJavascript), opens the wallet deeplink it returns, and calls you back. Pre-warm it at launch.
MainActivity.kt
FallbackRequired, and you open the visible FireblocksConnect for that same wallet.
3. Sign a message and transaction
After a successful connect, callsign() with any string, or signTransaction() with a serialized transaction (signing only — no broadcast).
MainActivity.kt
VersionedTransaction and receive base64-encoded signed bytes. Signing is only available for wallets connected through the headless engine.
4. Wire the manifest and redirect
Headless needs two manifest additions beyond the basic flow: aphantom-headless host on the same FireblocksRedirectActivity intent-filter, and a <queries> block so the app can open wallet deeplinks on Android 11+.
AndroidManifest.xml
FireblocksRedirectActivity
Common pitfalls
- Don’t call
webView.onPause()on the hiddenWebView. That suspends its relay socket. It stays alive for a normal app-switch; for long approvals a foreground service is the robust option. - Cancellation isn’t auto-detected by Custom Tabs. Treat “resumed with no result” as cancelled, or hold the pending flow in a
ViewModel. - Test on a device with a wallet installed — not a bare emulator.
- Serve over HTTPS. The flow mints WalletConnect URIs via WebCrypto, which needs a secure context.