简体   繁体   English

Ionic App Availability 插件(电容器)在 android 上总是返回 false

[英]Ionic App Availability plugin (capacitor) always returns false on android

the issue with my code is that it doesn't detect the application that is being installed on the android, it always returns false.我的代码的问题是它没有检测到正在安装在 android 上的应用程序,它总是返回 false。 I am following the official documentation from here ( https://ionicframework.com/docs/native/app-availability ) Here is my code:我正在关注这里的官方文档( https://ionicframework.com/docs/native/app-availability )这是我的代码:

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: output 总是:

com.twitter.android is NOT available

Kindly suggest me what is wrong in this?请建议我这有什么问题? Thankyou谢谢

I solved this issue by downgrading the version of https://capacitorjs.com/docs/apis/app-launcher to 1.0.9 and adding the tag inside the android manifest with the desired app url that I want to check from the android device. I solved this issue by downgrading the version of https://capacitorjs.com/docs/apis/app-launcher to 1.0.9 and adding the tag inside the android manifest with the desired app url that I want to check from the android device .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM