ViberApp 存在于 IONIC IOS

ViberApp is existing in IONIC IOS

现在我正在开发 IOS 应用程序,我想检查 Phone 中是否存在 Viber 应用程序。

我已经使用 Viber:\ URL 方案和 https://ionicframework.com/docs/native/app-availability/ 检查应用程序,但应用程序未检测到

有没有可能的实现方式?

谢谢

必须首先在 Info.plist 文件中公开声明 URLScheme 访问 this UseYourLoaf tutorial 了解更多详情

试试这个;

 import { AppAvailability } from '@ionic-native/app-availability';
    import { Platform } from 'ionic-angular';

    constructor(private appAvailability: AppAvailability, private platform: Platform) { }

    let app;

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

    this.appAvailability.check(app)
      .then(
        (yes: boolean) => console.log(app + ' is available'),
        (no: boolean) => console.log(app + ' is NOT available')
      );

我通过检查这些是否存在来修复它

viber = "https://itunes.apple.com/ph/app/viber-messenger-chats-calls/id382617920?mt=8"

使用应用可用性

this.appAvailability.check(viber)