GNSPS / URLSchemer

Angular Module for Cordova app to open other iOS / android url app schemes
10 stars 4 forks source link

ReferenceError: appAvailability is not defined #2

Closed asaivishal closed 9 years ago

asaivishal commented 9 years ago

Hi,

I installed this plugin and additional plugins required by this one.

I followed all the steps exactly as mentioned in README file.

When I run my app on emulator, I get below error (output from logcat):

I/chromium( 2269): [INFO:CONSOLE(17846)] "ReferenceError: appAvailability is not defined I/chromium( 2269): at Object.openLink (http://192.168.0.63:8100/js/urlschemer.js:55:29) I/chromium( 2269): at Object.$ionicActionSheet.show.buttonClicked (http://192.168.0.63:8100/js/controllers.js:131:41) I/chromium( 2269): at Scope.scope.buttonClicked (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:38675:626) I/chromium( 2269): at $parseFunctionCall (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:18514:294) I/chromium( 2269): at http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:47613:785 I/chromium( 2269): at Scope.$eval (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:20459:308) I/chromium( 2269): at Scope.$apply (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:20554:309) I/chromium( 2269): at HTMLButtonElement. (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:47612:791) I/chromium( 2269): at HTMLButtonElement.eventHandler (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:9736:157) I/chromium( 2269): at triggerMouseEvent (http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js:2540:53)", source: http://192.168.0.63:8100/lib/ionic/js/ionic.bundle.js (17846)

Could you please help me figure out what am I missing?

Thanks.

GNSPS commented 9 years ago

Could you please try and run the command to install the AppAvailability plugin again?

This is sometimes caused by installing a new platform (android or iOS) after installing some plugins.

Please let me know if that worked out for you.

asaivishal commented 9 years ago

Thank you so much. It seems re-installing AppAvailability plugin fixed above issue.

But now I ran into another issue:

Blocked (possibly sub-frame) navigation to non-allowed URL: comgooglemaps://maps?q=....

Do I need to add any settings into config.xml?

asaivishal commented 9 years ago

Actually not. It throws the same (first) error when it finds url scheme in the urlscheme.config.json file.

If there is no scheme present in json object, it tries to open given url in default browser.

GNSPS commented 9 years ago

Are you testing that in your browser or in some emulator?

AppAvailability won't work when testing in your browser because, as it is not a device, the plugin can't work in the environment.

Maybe I should add code so that if there's no plugin available it falls back to opening the normal URL. Gonna do that during the day, right now I'm working but when I can I'll do it! ;)

EDIT: Just checked in my commit. If you could confirm my assumptions above and test to see if it doesn't throw the error anymore that would be nice. ;)