3

I am trying to implement App Availability Feature in ionic. I have an app installed in my device and trying to check if that app exists from another app. But facing an issue in the same, getting the below error

enter image description here

1
  • please share code snippet to understand your problem better way Commented Mar 13, 2019 at 10:21

2 Answers 2

3

Possibly you are facing mismatch of ionic version of app and the plugin version you installed in your app. In Ionic V3 you no need to import from '../ngx';

Ionic V3 and V4 have Different plugin url

Ionic v3 plugins

Ionic v4 plugins.

For Ionic v3 App availability

 ionic cordova plugin add cordova-plugin-appavailability
 npm install --save @ionic-native/app-availability@4

And for Ionic V4 App availability

ionic cordova plugin add cordova-plugin-appavailability
npm install @ionic-native/app-availability

npm install cmd is different for both version

Try this steps

  1. remove plugin
  2. Add plugin for ionic V3 compatible from here
  3. Try to build now
Sign up to request clarification or add additional context in comments.

6 Comments

Hi @Sahil, Thanks for the reply. My Ionic version is v3, but still i am facing this issue. this was working in my earlier app but now its not working in the new app that i have created
@SajeedShaikh : Have you tried ionic v3 plugin because today only i tried with my project i was facing same issue with another plugin. are you importing from .../ngx
I am importing the same from ngx and i am using the ionic v3 plugin. ionicframework.com/docs/native/app-availability. this is from where i have tried the code.
@SajeedShaikh yes bro this is only problem , in ionic v3 you dont have to import from ngx. this is v4 plugin. you have to use plugin from this V3 plugin
Thanks bro, you saved my day, was struggling for this issue since yesterday. Thanks again. Really helped a lot.
|
0

I had this error: with the Ionic 5/ Capacitor app.

core.js:6479 ERROR Error: Uncaught (in promise): [object String] at resolvePromise (zone.js:1255) at zone.js:1162 at rejected (tslib.es6.js:74) at ZoneDelegate.invoke (zone.js:400) at Object.onInvoke (core.js:28705) at ZoneDelegate.invoke (zone.js:399) at Zone.run (zone.js:160) at zone.js:1318 at ZoneDelegate.invokeTask (zone.js:434) at Object.onInvokeTask (core.js:28692) defaultErrorLogger @ core.js:6479

I have used this code and works fine now. The problem for me was I didn't have Instagram App installed on my device. So it throws an exception. I have handled it like so:

async goToInstagram(): Promise<void> {
    let app: string;

    if (this.platform.is('ios')) {
      app = 'instagram://';
    } else if (this.platform.is('android')) {
      app = 'com.instagram.android';
    }

    try {
      const isAppAvailable = await this.appAvailability.check(app);

      isAppAvailable
        ? this.inAppBrowser.create(`instagram://user?username=${this.item.instagram}`, '_system')
        : this.inAppBrowser.create(`https://www.instagram.com/${this.item.instagram}`, '_system');
    } catch (err) {
      this.inAppBrowser.create(`https://www.instagram.com/${this.item.instagram}`, '_system');
    }
  }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.