How to open location shared in whatsap with my app ????

1,997 views
Skip to first unread message

Chisan Gelu

unread,
May 23, 2023, 6:09:15 PM5/23/23
to DroidScript
I tried with build.json  :


  "urlHost": "google.com",
   "urlScheme": "https"

or 

  "urlHost": "maps.google.com",
   "urlScheme": "https"

but didnt work.....   

I dont now what scheme whatsap use ....or if they use other method.....

When i click on location  shared in whatsap only options are google maps or bolt ....

Right2TheV0id

unread,
May 24, 2023, 12:33:10 PM5/24/23
to DroidScript
Did you try to build the "Receive Intent" sample to see if it shows up in the list of apps eligible to open a shared location in whatsapp?

Also I don't know if this is of any help but I share it just in case:

Chisan Gelu

unread,
May 24, 2023, 12:58:53 PM5/24/23
to DroidScript
Tried this : {
    "manifest": {        
        "urlHost": "da.me,map.google.com,maps.google.com,google.com",
        "urlScheme": "https,http,geo"
    }
}


Dont works.


I dont know how to use Intents....

Chisan Gelu

unread,
May 24, 2023, 1:20:43 PM5/24/23
to DroidScript
<activity android:name=".BrowserActivitiy"
          android:label="@string/app_name">

      <intent-filter>
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <data android:scheme="http"/>
         <data android:scheme="geo"/>
      </intent-filter>
</activity>



How to translate this to droidscript code???
https://developer.android.com/guide/components/intents-filters

Alan Hendry

unread,
May 24, 2023, 1:23:19 PM5/24/23
to DroidScript
HI,
I presume you mean that you are on WhatsApp and click an entry
and it opens Google maps, but you want to open your app.
First WhatsApp is issuing the intent, 
if it specifically sends the intent to Google maps
(package com.google.android.apps.maps) then you probably can't intercept it.
If it issues a view action with geo data 
then you may be able to be eligible to receive it
(need correct build.json settings, translated by the builder to the correct manifest settings)
Finally you need a function OnData to receive the geo data.
Regards, ah

Chisan Gelu

unread,
May 24, 2023, 1:46:17 PM5/24/23
to DroidScript
Is not google maps implicit....  whatsapp give more option to chose ....

On whatsap i click on  an shared location map....

Alan Hendry

unread,
May 24, 2023, 2:59:55 PM5/24/23
to DroidScript
HI,
Do you mean that WhatsApp gives you a choice, or 
Android gives you a choice of apps that handle the intent
(it usually gives you the choice of one time or always)?
Regards, ah

Right2TheV0id

unread,
May 24, 2023, 3:00:38 PM5/24/23
to DroidScript
@Chisan Gelu no need to understand Intents for the test, simply build the "Receive Intent" sample (if you are able to) and share a position with Whatsapp.
If the built sample doesn't show up in the list of eligible apps, this means that something is wrong.
You can also test it with google maps.

Chisan Gelu

unread,
May 24, 2023, 3:02:15 PM5/24/23
to DroidScript
Probably Android.....yes:  one time or always ..... and i never selected alaways.....every time when i click on a location map in whatsap it show the apps that can opening it...

Chisan Gelu

unread,
May 24, 2023, 3:24:54 PM5/24/23
to DroidScript
using this link in a web page: <a href="geo:23,23">My Map Link</a>  .... when i click android does same thing like whatsap location ....but my app is not in choose list.......

this is my build.json:

   "manifest": {        
        "urlHost": "da.me,map.google.com,maps.google.com,google.com",
        "urlScheme": "https,http,geo"
    }
}




Alan Hendry

unread,
May 24, 2023, 3:26:32 PM5/24/23
to DroidScript
HI,
That hints that it isn't specifying Google maps explicitly.
So you "just" need to get the right build.json and for the builder to create the correct manifest.
Regards, ah
Message has been deleted

Chisan Gelu

unread,
May 24, 2023, 5:22:16 PM5/24/23
to DroidScript
"manifest": {        
        "urlHost": "*,da.me,map.google.com,maps.google.com,google.com",
        "urlScheme": "https,http,geo"
    }
}


opens geo://23,23   ...but dosen.t open geo: 23,23    ..........whatsapp use last format....

Alan Hendry

unread,
May 25, 2023, 5:26:40 AM5/25/23
to DroidScript
HI,
I presume you mean that from html with the // it shows your app in the list
but without the slashes it doesn't.
We had some success in getting http intents with this build.json
{
    "manifest":
    {    
        "minSdkVersion": 23,
        "targetSdkVersion": 27,      
        "urlHost": "*",
        "urlScheme": "http,https"
    }
}
So I'd try that urlHost
Not sure if you have a space after geo: (I'd try without it)
Regards, ah

Chisan Gelu

unread,
May 29, 2023, 7:14:01 AM5/29/23
to DroidScript
Anybody give me a solution for this ???

Can open geo://23,23      but cant open geo:23,23    ....

Alan Hendry

unread,
May 29, 2023, 9:53:35 AM5/29/23
to DroidScript
HI,
I ain't no expert, but as far as I can see protocols
like http, https, ftp, and geo should always be followed by //
How are these requests generated in WhatsApp?
Regards, ah

Chisan Gelu

unread,
May 29, 2023, 9:57:23 AM5/29/23
to DroidScript
geo:47.969818115234375,25.94340705871582?q=47.9698181Screenshot_20230529_165633_Intent Intercept.jpg15234375,25.94340705871582

This is in whatsapp .

Alan Hendry

unread,
May 29, 2023, 10:31:15 AM5/29/23
to DroidScript
HI,
If you use a link in html then I'm pretty sure it has to have the slashes.
For a different thread (different problem) Dave suggested build.json with
urlHost": "*,*",
I'd try that instead of * 
Regards, ah

Chisan Gelu

unread,
May 29, 2023, 10:37:29 AM5/29/23
to DroidScript
In browser ...works ...    <a href="geo:23,23"> link </a>   ....but my app isn.t an option to open...

Right2TheV0id

unread,
May 29, 2023, 11:44:30 AM5/29/23
to DroidScript
I this this is because this is not a link but an intent containing the data "geo:49.96...".
Look at the "Recieve Intent" sample and try to intercept that intent.

Chisan Gelu

unread,
May 29, 2023, 3:02:20 PM5/29/23
to DroidScript

<intent-filter>


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


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


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




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


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




<data android:scheme="geo" />


</intent-filter> I found this..... need to be translated to DroidScript build.json...

Chisan Gelu

unread,
May 29, 2023, 4:15:34 PM5/29/23
to DroidScript
I confirm that what i wrote above works.....i edited my app Manifest fro PC and  added that code .....Need to be done in droidscript so dont edit Manifest from PC.....

This two lines are addition.

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

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

Reply all
Reply to author
Forward
0 new messages