ohh2ahh / AppAvailability

This Cordova / PhoneGap plugin allows you to check if an app is installed.
228 stars 117 forks source link

Checking if googlemaps is installed always invoke the success callback on IOS #39

Open anatoliyB opened 7 years ago

anatoliyB commented 7 years ago

Hi guys, I'm trying to use your plugin to check if google maps is installed here is my code:

        $cordovaAppAvailability.check('comgooglemaps://')
          .then(function () {
            console.log("google maps is installed");
          }, function () {
            console.log("google maps is not installed");
          });

The problem is that after i removed google maps app from my device success callback is still invoked for googlemaps app. At the same time in the case of whatsapp the plugin works correct and invokes to error call back after whatsapp removal. Also if i run the app on iOS simulator where google maps is not installed the plugin also works correct and invokes error callback. I'm using ionic framework and ng-cordova. device: iphone 5s iOS: 10.2.1 cordova: 6.4.0 cordova plaform ios version: 4.3.1 Xcode: 8.2.1 plugin version: 0.4.2

ohh2ahh commented 7 years ago

Hi @anatoliyB

Please don't include :// in the scheme. Try:

$cordovaAppAvailability.check('comgooglemaps').then(
  function() {
    console.log('Google Maps is installed');
  },
  function() {
    console.log('Google Maps is not installed');
  }
);
CK110 commented 7 years ago

hi @ohh2ahh if i remove :// , l get a error -canOpenURL: failed for URL: "comgooglemaps" - error: "Invalid input URL"

    this.appAvailability.check('comgooglemaps').then((res)=>{
          if(res){
            console.log("comgooglemaps"+res)
          }
        })
        <config-file parent="LSApplicationQueriesSchemes" platform="ios" target="*-Info.plist">
            <array>
                <string>baidumap</string>
                <string>iosamap</string>
                <string>comgooglemaps</string>
                <string>qqmap</string>
            </array>
        </config-file>
ghgithub commented 6 years ago

i removed google maps app from my device success callback is still invoked for googlemaps app too