Start TOMTOM navigation using Javascript and Android Intent

543 Views Asked by At

I have a web application that needs to open a destination in the native maps/navigation app on the device. On most Android devices this is google maps, and I can simply open a link that will open google maps with the directions to the passed destination (latitude, longitude coordinates). In the case of the TomTom Pro 8375, there seems to be no way of opening a destination in the navigator app from the browser.

We have tried this, amongst others, with the following:

  1.   tomtomgo://x-callback-url/navigate?destination=52.371183,4.892504
    
  2.   tomtomhome://geo:action=navigateto&lat=mylat&long=mylon&name=myname
    

Are there any known workarounds to achieve this? I have received this as a response from the support but this applies only for kotlin or java.

Uri gmmIntentUri = Uri.parse("google.navigation:q=52.0000,12.0000");

Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);

startActivity(mapIntent)

Is there a way that I can make this work in Javascript ?

I would really appreciate any suggestions!

Thank you!

1

There are 1 best solutions below

4
On

Too Long to be a comment

Not overly familiar with webapps however we do have 3 apps with Webfleet. Sadly we use Java not Javascript. And the intent we use is

String uri = "geo:0,0?q=" + <destination>;
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(uri)));

Not overly helpful for you however we must support both phones and the Pro tablets.

The format below is the standard for JavaScript ?

intent:
   HOST/URI-path // Optional host 
   #Intent; 
      package=[string]; 
      action=[string]; 
      category=[string]; 
      component=[string]; 
      scheme=[string]; 
   end; 

Which i would give you a rough estimate of:

intent://#Intent;action=android.intent.action.PICK;type=text/plain;S.android.intent.extra.TEXT=geo:0,0?q=52.0000,12.0000;end

I will also add the App that is Webfleets version of maps is called NavPadNavAppActivity, can try targeting that directly?