• About
  • Privacy Policy
  • Disclaimer
  • Contact
Soft Bliss Academy
No Result
View All Result
  • Home
  • Artificial Intelligence
  • Software Development
  • Machine Learning
  • Research & Academia
  • Startups
  • Home
  • Artificial Intelligence
  • Software Development
  • Machine Learning
  • Research & Academia
  • Startups
Soft Bliss Academy
No Result
View All Result
Home Software Development

Adding support for Google Pay within Android WebView

softbliss by softbliss
June 9, 2025
in Software Development
0
Adding support for Google Pay within Android WebView
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


Does your Android App embed a web checkout process by using a WebView?

We are happy to announce that Google Pay is now supported within Android WebView. This feature is available in WebView starting with version 137.


How does Google Pay within Android WebView work?

The solution uses the Payment Request API which allows launching Android payment apps when the website is embedded inside of a WebView.

Starting with Google Play Services 25.18.30 (available today), Google Pay will trigger the native payment sheet which means user device tokens will be available for facilitation when triggered from within a WebView.


What changes are required for my App?

Since the Payment Request API will be disabled by default for WebView, the following simple changes need to be implemented:

Add (or update) build dependency:

androidx.webkit:webkit:1.14.0

Kotlin

Add the following queries tags to your AndroidManifest.xml:

Enable the Payment Request API for the WebView you use in your App. Make sure to use the correct import statement. No other Google Pay specific changes are needed.

Kotlin (Compose):

import android.webkit.WebSettings;
import android.webkit.WebView;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;

AndroidView(
    factory = {
        WebView(it).apply {
            // Update WebView settings to allow JavaScript and payment request 
            settings.javaScriptEnabled = true            
            if (WebViewFeature.isFeatureSupported(
                    WebViewFeature.PAYMENT_REQUEST)) {
                WebSettingsCompat.setPaymentRequestEnabled(settings, true);
            }
        }
    },
    update = {
      it.loadUrl(url)
    }
)

Kotlin

import android.webkit.WebSettings;
import android.webkit.WebView;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;

WebView webView = findViewById(R.id.webview);
WebSettings webSettings = webView.getSettings();

// Update WebView settings to allow JavaScript and payment request
webSettings.setJavaScriptEnabled(true);
if (WebViewFeature.isFeatureSupported(WebViewFeature.PAYMENT_REQUEST)) {
    WebSettingsCompat.setPaymentRequestEnabled(webSettings, true);
}

Java

An approved Android app integration

An approved Android app integration

Unlock seamless payments in your Android App

Supporting Google Pay within Android WebView allows you to offer Google Pay to your Android users when embedding your web checkout in your app. For more assistance with your implementation, sign in to the Google Pay & Wallet Console to create a support ticket. In addition, you can join the developer community in the #payments channel on Discord.

Follow @GooglePayDevs on X for future updates. If you have questions, tag @GooglePayDevs and include #AskGooglePayDevs in your tweets.



Tags: AddingAndroidGooglePaySupportWebView
Previous Post

The Benefits of Professional Society Involvement (opinion)

Next Post

Improve Vision Language Model Chain-of-thought Reasoning

softbliss

softbliss

Related Posts

Your Guide to Building Apps
Software Development

Your Guide to Building Apps

by softbliss
June 9, 2025
AI updates from the past week: OpenAI Codex adds internet access, Mistral releases coding assistant, and more — June 6, 2025
Software Development

AI updates from the past week: OpenAI Codex adds internet access, Mistral releases coding assistant, and more — June 6, 2025

by softbliss
June 8, 2025
Thoughts on Streaming Services: 2024 Edition
Software Development

Thoughts on Streaming Services: 2024 Edition

by softbliss
June 8, 2025
Autonomous coding agents: A Codex example
Software Development

Autonomous coding agents: A Codex example

by softbliss
June 7, 2025
CoPilot Platform: The Dawn of a New Era in Coding and Software Development
Software Development

CoPilot Platform: The Dawn of a New Era in Coding and Software Development

by softbliss
June 7, 2025
Next Post

Improve Vision Language Model Chain-of-thought Reasoning

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Premium Content

NVIDIA Open Sources Parakeet TDT 0.6B: Achieving a New Standard for Automatic Speech Recognition ASR and Transcribes an Hour of Audio in One Second

May 6, 2025

MM-Ego: Towards Building Egocentric Multimodal LLMs

April 12, 2025

Google’s new open model based on Gemini 2.0

March 30, 2025

Browse by Category

  • Artificial Intelligence
  • Machine Learning
  • Research & Academia
  • Software Development
  • Startups

Browse by Tags

Amazon App Apps Artificial Blog Build Building Business Coding Data Development Digital Framework Future Gemini Generative Google Guide Impact Innovation Intelligence Key Language Large Learning LLM LLMs Machine Microsoft MIT model Models News NVIDIA opinion OReilly Research Series Software Startup Startups students Tech Tools Video

Soft Bliss Academy

Welcome to SoftBliss Academy, your go-to source for the latest news, insights, and resources on Artificial Intelligence (AI), Software Development, Machine Learning, Startups, and Research & Academia. We are passionate about exploring the ever-evolving world of technology and providing valuable content for developers, AI enthusiasts, entrepreneurs, and anyone interested in the future of innovation.

Categories

  • Artificial Intelligence
  • Machine Learning
  • Research & Academia
  • Software Development
  • Startups

Recent Posts

  • Google DeepMind and Isomorphic Labs introduce AlphaFold 3 AI model
  • Improve Vision Language Model Chain-of-thought Reasoning
  • Adding support for Google Pay within Android WebView

© 2025 https://softblissacademy.online/- All Rights Reserved

No Result
View All Result
  • Home
  • Artificial Intelligence
  • Software Development
  • Machine Learning
  • Research & Academia
  • Startups

© 2025 https://softblissacademy.online/- All Rights Reserved

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?