docs(payments): intercept wallet deeplinks on API 23 in Android PayWebView sample#89
Conversation
…iew sample Promote the "if you support minSdk < 24, also override the deprecated overload" note into actual code: add a shared handleWalletDeeplink helper and override both shouldOverrideUrlLoading overloads. On API 23 only the deprecated String overload fires, so without it wc: wallet deeplinks load inside the WebView instead of opening the wallet. Mirrors the reown-kotlin dapp sample implementation (reown-kotlin PR #419).
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
Pull request overview
This PR updates the WalletConnect Pay WebView integration guide’s Android (Kotlin) PayWebView sample so wallet deeplink interception works on API 23 by overriding both shouldOverrideUrlLoading overloads and sharing the interception logic.
Changes:
- Adds a shared
handleWalletDeeplink(context, url)helper for deeplink handling. - Overrides both
shouldOverrideUrlLoading(WebView?, WebResourceRequest?)(API 24+) and the deprecatedshouldOverrideUrlLoading(WebView?, String?)(API 23) to ensure consistent behavior. - Adds the missing
android.content.Contextimport required by the new helper.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…ebView samples The prose (Wallet Deeplink Interception + Best Practices) and the iOS sample block non-https schemes, but the React Native, Kotlin, and Flutter samples allowed them. Align all three: forward wc: wallet deeplinks, allow https + about:, and block any other scheme (tel:, sms:, intent:, …) so the page can't drive the OS into arbitrary native apps. Addresses the Copilot review comment on the Android sample.
|
Good call — addressed in e817633. The prose and the iOS sample already blocked non- |
Summary
Follow-up to #86. The Android (Kotlin)
PayWebViewsample inpayments/wallets/webview.mdxcurrently only overridesshouldOverrideUrlLoading(WebView?, WebResourceRequest?)(API 24+) and carries a comment telling readers to also add the deprecated overload for minSdk < 24. This promotes that note into actual code so copy-paste works on API 23.On API 23 the WebView calls the deprecated
shouldOverrideUrlLoading(WebView?, String?)overload; since the sample didn't override it,wc:wallet deeplinks loaded inside the WebView instead of opening the wallet app — the core interception silently no-ops.Change
handleWalletDeeplink(context, url)helper (forwardswc:links to the OS, returnsfalseotherwise).shouldOverrideUrlLoadingoverloads, delegating to the helper.import android.content.Context.Mirrors the reown-kotlin dapp sample implementation validated in reown-com/reown-kotlin#419 (this fix was raised by the automated review there and applied to the shipped sample).
Only the Android (Kotlin) tab changed — RN/iOS/Flutter and all prose untouched.