Open the Google Maps app review modal directly from an Android app

· 371 words · 2 minute read

Google Maps application supports deep links, which means you can open the Google Maps app directly from another app.

A few weeks ago, I had to investigate the possibility of opening the Google Maps app from another Android app using deep linking. In general, common operations with Google Maps are well-known and, whether documented or not, it’s easy to find examples of how to do them. However, in this case, the goal was to open the review modal for a location, something I was quite sure was possible. For this, Google Maps must have defined an intent filter in its AndroidManifest.xml. There is not much documentation about this, so I decided to do some research.

In Android it’s especially easy to unpack an .apk file. There are several tools that allow you to do this, in this case I used Apktool.

The command to unpack the apk is the following:

apktool d google-maps.apk

This will generate a directory with the name of the application, in this case google-maps. At the root, you will find the AndroidManifest.xml file, which contains information about the application and also, the intent filters of the application.

Inside the file, we find the following intent filter:

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="http"/>
    <data android:scheme="https"/>
    <data android:host="search.google.com"/>
    <data android:path="/local/writereview/mobile"/>
</intent-filter>

The regular web url that can be visited to write a review is https://search.google.com/local/writereview?placeid=. As you can see, this url is not defined in the intent filter. However, we have a url with the same objective, but with a different path: https://search.google.com/local/writereview/mobile?placeid=, this is the one that is defined in the intent filter, and that we will use to open the review modal from our app using deep linking and the Google Maps application.

Several points to consider about this:

  • This intent is not officially documented, so there is no guarantee that it will work in future versions of the application.
  • This url only works for the Google Maps mobile application, not for the web, on the web you must use the normal url.

My recommendation is to always take the user to the normal url, which will work on any device. I have not investigated if it behaves the same way on iOS.