URL schema comgooglemaps does not start on Android device (SH-01G)

Asked 2 years ago, Updated 2 years ago, 89 views

In the case of Android devices in Javascript, Google Maps is
in the URL schema comgooglemaps. You are experiencing a non-bootable symptom.This is happening on the following Android devices.

Aquos Zeta SH-01G

The target browser is "chrome" and the target Javascript source is as follows:

if(navigator.userAgent.indexOf('Android')>0){
            alert('Go to the Google Map app.');
            location.href = 'comgooglemaps://?daddr = ' + destination latitude + ', ' + destination longitude;
        } else{
            alert('Go to the Apple Map app.');
            location.href = 'http://maps.apple.com/maps?daddr=' + destination latitude +', ' + destination longitude;
        }

Debugging on the actual machine and displaying "Go to Google Map App" on alert is
I have confirmed that the Google Map application was
processed with the URL schema comgooglemaps. US>Exit without booting

We cannot determine the cause, so we are having trouble dealing with it.
If you know how to deal with it, please let me know.

javascript android google-chrome google-maps

2022-09-30 20:12

1 Answers

I think calling the app by requesting a URL with a special scheme in your browser is a feature of iOS.

On Android, if you request the URL of the web version as it is, you can call the corresponding app (if installed).Therefore, I think it will work if you do the same as the URL that seems to call the Apple map below.The parameters seem to be the same as Google Maps.

 location.href='https://maps.google.com/maps?daddr=' + destination latitude +', '+ destination longitude;


2022-09-30 20:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.