Ionic Capacitor App Availability not working on android

Hey, the issue with my code is that it doesn’t detect the application that is being installed on the android, it always returns false.
I am following the official documentation from here (App Availability - Cordova Plugin for iOS and Android Devices)
Here is my code:

import { AppAvailability } from '@awesome-cordova-plugins/app-availability/ngx';
import { Platform } from 'ionic-angular';

app:any;

constructor(
    private appAvailability: AppAvailability, 
    private platform: Platform
) { 
  this.app = 'com.twitter.android';
  this.platform.ready().then(() => {
  this.appAvailability.check(this.app)
  .then(
    (yes: boolean) => console.log(this.app + ' is available'),
    (no: boolean) => console.log(this.app + ' is NOT available')
  );
}
}

And the output is always:
com.twitter.android is NOT available
Kindly suggest me what is wrong in this? Thankyou

The plugin has not been updated since 2019, so it’s missing important information.
The @capacitor/app-launcher plugin, which is similar to that plugin, has this note about Android 11:

Note: On Android 11 and newer you have to add the app package names you want to query in the AndroidManifest.xml inside the queries tag.

Example:

<queries>
    <package android:name="com.getcapacitor.myapp" />
</queries>

You need to add a new <package android:name="xxx.yyy.zzz" /> for every package you want to query.

1 Like