Consent WebView Event Bridge
The Consent WebView Event Bridge is how your App-to-App native shell and Biza's hosted consent page talk to each other while the page is open inside your in-app WebView. It carries the consent token in, and the completion or failure signal back out.
A pair of message channels between the hosted consent page's JavaScript and your native shell's code β not a cookie, not localStorage, and not a URL.
The three messagesβ
| Direction | Message | Carries | When |
|---|---|---|---|
| Native β page | Token handoff | The short-lived consent token from your backend's token exchange | Before the page loads |
| Page β native | Completion | The redirect URL and JARM response | The Consumer authorises or denies |
| Page β native | Failure | Nothing beyond the failure itself | The page never receives a usable token |
On failure, the hosted consent page renders nothing β there is no fallback-branded error screen. Your native shell is responsible for handling the failure signal itself (for example, by falling back to the web OTP flow). Don't build a screen for this on the page side; it won't come.
Why a bridge, and not localStorage or a URLβ
The consent token is never written to localStorage, sessionStorage or document.cookie, and it never appears in a URL or query string. It exists only as an in-memory JavaScript value for the lifetime of the one page load that needs it.
The completion signal is an explicit call the page makes, not a navigation the native shell intercepts β so it doesn't depend on the page actually triggering a real browser navigation, and it doesn't race against the OS's own (and sometimes inconsistent) Universal Link / App Link auto-handling for a link that targets the app hosting the WebView.
Platform mechanismsβ
So a mobile team can scope the work now, the mechanism family per platform:
- iOS (minimum iOS 15): a
WKUserScriptinjected at.atDocumentStart, in a non-defaultWKContentWorldso the token-bearing value is isolated from the page's own script context, withWKScriptMessageHandlercarrying messages back. - Android (minimum Android 8.0):
WebView.evaluateJavascript()to hand the token in, preferring the origin-scopedWebViewCompat.addWebMessageListener(Jetpackandroidx.webkit) for the return channel over the legacyaddJavascriptInterface.
Navigation interception (WKNavigationDelegate / WebViewClient.shouldOverrideUrlLoading) is reserved for a different job β your shell's own dispatch of the recipient's deep link once the flow completes β not for anything on this bridge.
Who owns whatβ
Biza owns the event bridge's specification and the hosted consent page's side of it. You own your native shell's implementation against that specification: priming the bridge with the token, and handling the completion and failure messages it sends back.
The exact handler/interface names, content-world identifier, and message payload schemas are Biza's to publish, and will land on this page ahead of the first pilot. Don't implement against a guess β nothing here is a committed wire format yet.