All articles

Tutorial

How to Prompt for Google Play Reviews in an Android TWA

September 23, 2026 · 7 min read

The Review Challenge in Trusted Web Activities

Google Play Store ratings and reviews are key drivers for organic app discoverability, conversion rates, and credibility. When developers write fully native Android applications, they utilize the Google Play In-App Review API. This native SDK displays a modal directly inside the app, allowing users to select a star rating and write a review without navigating away from the current screen.

However, Progressive Web Apps packaged using a standard Trusted Web Activity (TWA) do not have direct access to Google's native Java-based ReviewManager class from their client-side JavaScript. This presents a technical obstacle: how can you trigger review prompts seamlessly when your app runs within a web context? This guide outlines the two primary paths for TWA developers, detailing direct deep-linking patterns and hybrid native-to-web communication strategies.

Method 1: Direct Play Store Deep Linking

The most reliable, low-overhead method to collect reviews in a standard TWA is to deep link the user directly to your application's Google Play Store listing. While this redirects the user outside of your app container into the native Google Play Store app, it requires absolutely no native Android modification, works immediately on all devices, and requires zero extra maintenance.

To implement this, you should construct a link using the market custom protocol scheme, falling back to a standard web URL if the market protocol fails or if the user is testing the app outside of an Android device environment.

The market scheme format is as follows: market://details?id=YOUR_PACKAGE_NAME. When an Android device processes this scheme, it opens the Google Play Store application directly to your app page, bypassing the browser entirely.

function openPlayStoreReview(packageName) { const marketUri = "market://details?id=" + packageName + "&showAllReviews=true"; const webUri = "https://play.google.com/store/apps/details?id=" + packageName; if (/Android/i.test(navigator.userAgent)) { window.location.href = marketUri; } else { window.open(webUri, "_blank"); } }

Using the query parameter showAllReviews=true on supported Play Store versions will land the user directly on the review tab, lowering the friction required for them to submit their feedback.

Method 2: Integrating the Native Review API via Web Messages

If you require a completely seamless, overlay-style review experience without exiting your TWA, you must interface with Android's native ReviewManager. To do this, you cannot rely on plain JavaScript alone. Instead, your PWA must communicate with a custom TWA native shell using a Web Message Channel.

This method requires minor modifications to the Java or Kotlin wrapper that hosts your TWA. You establish a communication bridge where your PWA sends a string signal, and the Android wrapper catches it, instantiates the ReviewManager, and presents the review dialog.

First, implement the JavaScript trigger in your PWA. You check if the web message port is available, which indicates your PWA is running inside your custom TWA wrapper:

function requestNativeReview() { if (window.androidChannel) { window.androidChannel.postMessage("TRIGGER_REVIEW_PROMPT"); } else { console.log("Fallback to standard deep link"); openPlayStoreReview("your.app.package"); } }

In the Android wrapper's Java configuration, you must set up a custom WebMessagePort listener. When the event matching your message string is received, the native app executes the standard Play Review SDK workflow:

ReviewManager manager = ReviewManagerFactory.create(context); Task<ReviewInfo> request = manager.requestReviewFlow(); request.addOnCompleteListener(task -> { if (task.isSuccessful()) { ReviewInfo reviewInfo = task.getResult(); Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo); flow.addOnCompleteListener(reviewTask -> { Log.d("TWA_Review", "Review flow complete"); }); } else { Log.e("TWA_Review", "Review flow failed to load"); } });

This hybrid approach retains the user inside your web app container while displaying the identical review sheet native Android users experience. However, keep in mind this requires building and compiling a custom TWA launcher shell rather than using standard automated TWA templates.

Best Practices for Timing Review Prompts

Regardless of whether you use the deep-linking pattern or the native Review API bridge, prompting users at the wrong moment will lead to negative ratings. Google enforces strict quotas on how often the native review prompt can be shown (typically only once in a multi-week period), meaning you must make your prompts count.

To ensure high ratings and prevent user frustration, follow these key implementation guidelines:

  • Never prompt on app launch: Users want to complete their intended task immediately. Prompting them as soon as they open the app leads to high dismissal rates.
  • Trigger after positive milestones: Show the prompt when a user successfully completes an order, exports a project, finishes a game level, or hits a productivity goal.
  • Filter using a preliminary feedback check: Ask a simple in-app question first (e.g., "Are you enjoying our app?"). If they choose "Yes," prompt them for a Play Store review. If they choose "No," redirect them to an internal feedback form to capture constructive criticisms privately.
  • Set a minimum usage duration: Ensure a user has spent a reasonable amount of time inside your app before prompting. For example, check that they have opened the app at least 3 distinct times over a 7-day period.

Review Method Comparison

Use the following comparison to decide which rating implementation aligns best with your team's development resources and user experience goals:

FeatureDirect Deep LinkNative Review API via Bridge
Implementation ComplexityVery Low (Pure JS)Moderate (Requires Custom Java/Kotlin Wrapper)
User FrictionMedium (Switches App to Play Store)Low (Inline Modal Overlay)
Google Quota LimitsNoneStrict (Google limits occurrences dynamically)
Offline CapabilityFails (Requires instant app-store connection)Fails to display UI if not previously cached

For most indie makers and small SaaS teams, starting with a well-timed, platform-detected deep link provides the highest return on investment. As your app scales and user experience becomes highly optimized, transitioning to a native bridge will allow you to capture extra rating conversions by keeping users fully within your custom application UI.

Ready to ship your Android app?

Paste your PWA URL, get a signed APK and a Google Play ready AAB in minutes.

Build my app