• About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
Thursday, July 10, 2025
mGrowTech
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
No Result
View All Result
mGrowTech
No Result
View All Result
Home Google Marketing

Adding support for Google Pay within Android WebView

Josh by Josh
May 29, 2025
in Google Marketing
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-rc01

Kotlin

The stable version of 1.14.0 follows beginning of June

Add the following queries tags to your AndroidManifest.xml:

<!--
  Allow Chromium defined actions PAY, IS_READY_TO_PAY,
  UPDATE_PAYMENT_DETAILS to be initiated in your Android App or SDK
-->
<queries>
  <intent>
    <action android:name="org.chromium.intent.action.PAY"/>
  </intent>
  <intent>
    <action android:name="org.chromium.intent.action.IS_READY_TO_PAY"/>
  </intent>
  <intent>
    <action android:name="org.chromium.intent.action.UPDATE_PAYMENT_DETAILS"/>
  </intent>
</queries>

Kotlin

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.





Source_link

READ ALSO

Introducing Gemini with photo to video capability

Android’s Circle to Search feature gets AI and gaming upgrades

Related Posts

Introducing Gemini with photo to video capability
Google Marketing

Introducing Gemini with photo to video capability

July 10, 2025
Android’s Circle to Search feature gets AI and gaming upgrades
Google Marketing

Android’s Circle to Search feature gets AI and gaming upgrades

July 10, 2025
Advancing agentic AI development with Firebase Studio
Google Marketing

Advancing agentic AI development with Firebase Studio

July 10, 2025
How to use Gemini on a Wear OS smartwatch
Google Marketing

How to use Gemini on a Wear OS smartwatch

July 10, 2025
Smartwatches and fitness trackers we love are on sale during Prime Day
Google Marketing

Smartwatches and fitness trackers we love are on sale during Prime Day

July 10, 2025
T5Gemma: A new collection of encoder-decoder Gemma models
Google Marketing

T5Gemma: A new collection of encoder-decoder Gemma models

July 10, 2025
Next Post
We’re Officially Great Place to Work-Certified™ (Again!)

We're Officially Great Place to Work-Certified™ (Again!)

POPULAR NEWS

Communication Effectiveness Skills For Business Leaders

Communication Effectiveness Skills For Business Leaders

June 10, 2025
7 Best EOR Platforms for Software Companies in 2025

7 Best EOR Platforms for Software Companies in 2025

June 21, 2025
Eating Bugs – MetaDevo

Eating Bugs – MetaDevo

May 29, 2025
Top B2B & Marketing Podcasts to Lead You to Succeed in 2025 – TopRank® Marketing

Top B2B & Marketing Podcasts to Lead You to Succeed in 2025 – TopRank® Marketing

May 30, 2025
App Development Cost in Singapore: Pricing Breakdown & Insights

App Development Cost in Singapore: Pricing Breakdown & Insights

June 22, 2025

EDITOR'S PICK

Google Calendar is now on the Apple Watch

Google Calendar is now on the Apple Watch

July 1, 2025
PoE-World + Planner Outperforms Reinforcement Learning RL Baselines in Montezuma’s Revenge with Minimal Demonstration Data

PoE-World + Planner Outperforms Reinforcement Learning RL Baselines in Montezuma’s Revenge with Minimal Demonstration Data

June 20, 2025
The 5 Biggest Copywriting Mistakes in Advertising (And How To Fix Them). — Bolder&Louder

The 5 Biggest Copywriting Mistakes in Advertising (And How To Fix Them). — Bolder&Louder

June 10, 2025
Tools and Tips to Get Started

Tools and Tips to Get Started

June 8, 2025

About

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow us

Categories

  • Account Based Marketing
  • Ad Management
  • Al, Analytics and Automation
  • Brand Management
  • Channel Marketing
  • Digital Marketing
  • Direct Marketing
  • Event Management
  • Google Marketing
  • Marketing Attribution and Consulting
  • Marketing Automation
  • Mobile Marketing
  • PR Solutions
  • Social Media Management
  • Technology And Software
  • Uncategorized

Recent Posts

  • AWS doubles down on infrastructure as strategy in the AI race with SageMaker upgrades
  • NVIDIA AI Released DiffusionRenderer: An AI Model for Editable, Photorealistic 3D Scenes from a Single Video
  • How to Get Featured in AI Overviews (Based on Data)
  • What’s Your Event Vibe? Inside a Low-key Fujifilm Launch
  • About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions

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