← Back to discussions

UPI apps aren't opening from WebView (PhonePe, GPay, Paytm)

KKartik MPublished 6/17/20262486 views1 comments

When clicking on a UPI payment button (upi://pay?...) inside our WebView app, it prints an error: net::ERR_UNKNOWN_URL_SCHEME.

The browser opens UPI apps correctly, but the WebView doesn't. What intent handler do we need to add in Android?

1 Comments

KKevin O6/17/2026

You need to override shouldOverrideUrlLoading in your WebViewClient. When the URL starts with upi://, parse the URL and launch it as a native Intent:

kotlin
if (url.startsWith("upi://")) {
    val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
    context.startActivity(intent)
    return true
}

This is already configured in Nativine's templates so payments work seamlessly.

Please log in to reply.
WhatsApp