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
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
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With