Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova - How to detect whether google maps app is installed

I am building a hybrid app using cordova. I would like to detect whether google maps app has been installed on ios and android devices.

Before redirecting to google maps app i would like to check whether the app is acutally installed on device.

I am redirecting using following urls -

For ios : comgooglemaps://maps.google.com/

For android: geo:0,0?q

Thanks in advance

like image 771
Coder Avatar asked Jan 29 '26 03:01

Coder


1 Answers

This can be achieved using ngCordova plugins. http://ngcordova.com/

Using $cordovaAppAvailability we can identify whether any app is installed or not using its URI Scheme. Detailed docs here

For google maps URI schemes are -

Android: com.google.android.apps.maps ios: comgooglemaps://

$cordovaAppAvailability
    .check('com.google.android.apps.maps')
    .then(function(success) {
      // success
    },
    function (error) {
      // error
    });
like image 179
Coder Avatar answered Jan 31 '26 17:01

Coder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!