Skip to content

docs(payments): intercept wallet deeplinks on API 23 in Android PayWebView sample#89

Merged
juanisierra merged 2 commits into
mainfrom
wcagent/webview-android-api23-overload
Jul 23, 2026
Merged

docs(payments): intercept wallet deeplinks on API 23 in Android PayWebView sample#89
juanisierra merged 2 commits into
mainfrom
wcagent/webview-android-api23-overload

Conversation

@ignaciosantise

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #86. The Android (Kotlin) PayWebView sample in payments/wallets/webview.mdx currently only overrides shouldOverrideUrlLoading(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

  • Add a shared handleWalletDeeplink(context, url) helper (forwards wc: links to the OS, returns false otherwise).
  • Override both shouldOverrideUrlLoading overloads, delegating to the helper.
  • Add 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.

…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).
@mintlify

mintlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wc-pay-docs 🟢 Ready View Preview Jul 22, 2026, 6:15 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@ignaciosantise
ignaciosantise marked this pull request as ready for review July 22, 2026 18:18
Copilot AI review requested due to automatic review settings July 22, 2026 18:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 deprecated shouldOverrideUrlLoading(WebView?, String?) (API 23) to ensure consistent behavior.
  • Adds the missing android.content.Context import required by the new helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread payments/wallets/webview.mdx
@mintlify

mintlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
wc-pay-docs 🟡 Building Jul 22, 2026, 6:14 PM

💡 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.
@ignaciosantise

Copy link
Copy Markdown
Collaborator Author

Good call — addressed in e817633. The prose and the iOS sample already blocked non-https schemes, so I aligned the React Native, Kotlin, and Flutter samples too: forward wc: wallet deeplinks, allow https + about:, and block anything else (tel:, sms:, intent:, …) so the page can't drive the OS into arbitrary native apps.

@juanisierra
juanisierra merged commit 90dd626 into main Jul 23, 2026
4 checks passed
@juanisierra
juanisierra deleted the wcagent/webview-android-api23-overload branch July 23, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants