Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
anatoliyB opened this issue Mar 6, 2017 · 3 comments

Comments

@anatoliyB
Copy link

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
Copy link
Owner

ohh2ahh commented Mar 18, 2017

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
Copy link

CK110 commented Jul 18, 2017

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
Copy link

ghgithub commented Feb 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants