'Latitude and Longitude from google's geocoder not working on waze
I am trying to make this link work on waze app:
https://waze.com/ul?ll=-58.440634,-34.611324&z=10
Those are the lattitude and longitude given by google's geocoder with address Felipe Vallese 490, Buenos Aires):
On the web it points out the location:
But in the app (clicking the link on an email and selecting open with waze) it says "uh oh could not locate endpoint".
If i search the address "Felipe Vallese 490" in the app it finds it and let me navigate to it as well.
Reading the docs i see there's a search way:
https://waze.com/ul?q=Felipe%20Vallese%20490
In the app it give me the list of results and another tab with "Places", there i can select the location but i think giving this option to users is not very suitable, i think this will be ok if i can make it show "places" tab as default not search results.
I also tried with different lat and long with same results.
What could it be?.
Reggards!
Solution 1:[1]
If you directly want to open the Waze you can read the below link:
https://developers.google.com/waze/deeplinks#navigate-to-location overall Waze deep link should be something like this format:
https://www.waze.com/ul?ll=35.699636,51.337608&navigate=yes&zoom=17
Otherwise, if you want to open all navigation apps list and select an application using the below code:
val uri = Uri.parse(
String.format(
"geo:0,0?q=%s,%s",
latitude,
longitude
) //result would be like : geo:0,0?q=35.699636,51.337608
)
val geoIntent = Intent(ACTION_VIEW, uri).apply {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
flags = FLAG_ACTIVITY_REQUIRE_NON_BROWSER
}
}
startActivity(geoIntent)
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 |