3

I would like to open the Waze app from a web browser but the links I have in my db are in this format:

When I click on these links from my mobile web browser they open the app but the navigation doesn't begin, it's only opens the app and that's it.

After reading the updated waze api I haven't found a way to navigate using the encrypted string
hsv9hc540y
only by latitude and longitude which I don't have.

How can I convert those waze.to links to the new deep links api using the encrypted string I have so it will open the app and init navigation?

Offir
  • 3,252
  • 3
  • 41
  • 73
  • what happend if you do this ? https://www.waze.com/ul?q=sv8wrg7c5 instead of the url you are passing now ? because as the doc says To search for an address and then navigate to that address: you need to use ul?q= – Gastón Saillén Jan 31 '18 at 14:48

2 Answers2

11

Your deep links are not correct. To make them work, they need to look like this:

For more info, check this link: https://developers.google.com/waze/deeplinks/

Gil Moshayof
  • 16,633
  • 4
  • 47
  • 58
  • thats right, i was aware to post it as an aswer because i dont know too much about waze haha, but thats correct – Gastón Saillén Jan 31 '18 at 14:50
  • is the same to use this ? waze.com/ul?q=sv8wrg7c5 as the link ? thanks – Gastón Saillén Jan 31 '18 at 14:54
  • I'm afraid not. This deep-link form is for search, where q is the search term. Passing this hash code is essentially telling waze to search for some gibberish. – Gil Moshayof Jan 31 '18 at 14:55
  • @GilMoshayof thank you Gil, When `waze.to` was obsolete? – Offir Jan 31 '18 at 15:17
  • 1
    You're very welcome! The waze.to form became obsolete about a year ago (more or less). The /ul/ form (stands for Universal Link) will lead the user to a Waze web page if Waze is not installed on the device. – Gil Moshayof Jan 31 '18 at 15:18
  • Also though - waze.to links should still work (but not for long) - just without an additional path symbol: "http://waze.to/hsv9hc540y" – Gil Moshayof Jan 31 '18 at 15:23
  • @GilMoshayof it would be nice if you tell your friends to add this to waze deep links documentation. – Offir Feb 01 '18 at 08:56
  • @GilMoshayof I'm trying to use waze navigation from iOS app. I don't have long/lat, only address and I can't make it work. I try `"waze://?q=30+Ibn+Gabirol+St.+Tel+aviv,+Israel"` with no luck. It opens Waze, but doesn't navigate... Help? – Gal Feb 26 '18 at 09:28
  • How do you generate the shortened link? The documentation in https://developers.google.com/waze/deeplinks/ only provides long links. – rodsarria Apr 02 '19 at 22:59
  • how to pass parameters to avoid highways/tolls/ferries ? – Zahur Sh Apr 17 '19 at 13:21
  • I want to know if is it any way possible to add multiple directions in the same link? – Jalil Jun 20 '19 at 13:59
1
try {
            // Launch Waze
            String mapRequest = "https://waze.com/ul?q=" + latLng.latitude + "," + latLng.longitude + "&navigate=yes&zoom=17";
            Uri gmmIntentUri = Uri.parse(mapRequest);
            Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
            mapIntent.setPackage("com.waze");
            startActivity(mapIntent);
            } catch (ActivityNotFoundException e) 
            {
            // If Waze is not installed, open it in Google Play
            Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.waze"));
            startActivity(intent);
            }