'how to make android suggest my app for opening location sent from whatsapp?

I have added a deep link in manifest

i added this host "maps.google.com" that i found from whatsapp location but that s not working

I tried

<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:host="maps.google.com"
        android:pathPrefix="/maps"
        android:scheme="http" />
    <data
        android:host="maps.google.com"
        android:pathPrefix="/maps"
        android:scheme="https" />
</intent-filter>

and just like other deep links defined in manifest i expect android suggest the app in disambiguation dialog ...can anyone help me?



Solution 1:[1]

You must implement a Geo Service Activity

The Geo Service Activity catches android.intent.action.VIEW from online mapservices. Here is a working example:

Manifest

<!-- get geo-location from online mapservices (google, yandex, here, openstreetmap)  -->
<intent-filter>
    <data android:scheme="http" />
    <data android:scheme="https" />
    <data android:host="maps.google.com" />
    <data android:host="maps.google.de" />
    <data android:host="www.openstreetmap.org" />
    <data android:host="openstreetmap.org" />
    <data android:host="maps.yandex.ru" />
    <data android:host="maps.yandex.com" />
    <data android:host="here.com" />
    <data android:host="www.here.com" />
    <data android:host="share.here.com" />
    <data android:host="goto.here.com" />
    <data android:host="go.here.com" />
    <data android:host="wego.here.com" />

    <action android:name="android.intent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

Geo Service Activity

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    Intent intent = getIntent();
    
    if (intent != null) {
        Object uri = intent.getData();
        message.append(MessageFormat.format("Received action:{0}\n - data:{1}\n", intent.getAction(), uri));

        if (uri != null) {
    // parse uri
            .... process uri

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 k3b