【问题标题】:Xamarin forms: AppStore app page is not opening when new version is available?Xamarin 表单:当新版本可用时,AppStore 应用程序页面未打开?
【发布时间】:2020-02-01 03:12:12
【问题描述】:

我正在使用Plugin.LatestVersion NuGet 包来检查新版本的可用性。

我的代码:

using Plugin.LatestVersion;

var isLatest = await CrossLatestVersion.Current.IsUsingLatestVersion();

if (!isLatest)
{
    var update = await DisplayAlert("New Version", "There is a new version of this app available. Would you like to update now?", "Yes", "No");

    if (update)
    {
        await CrossLatestVersion.Current.OpenAppInStore();
    }
}

在 android 和 IOS 中,如果有新版本可用,则显示警报可以正常工作。 对于 android 应用,如果在警报中点击“是”,它将在 Play 商店应用中加载应用页面。

但对于 ios,当点击是选项形成警报时,应用页面不会加载。 Cannot connect to AppStore 显示在 Appstore 应用中。

截图:

我也尝试过await CrossLatestVersion.Current.OpenAppInStore("app bundle name");,但在 AppStore 上显示相同的屏幕。

【问题讨论】:

    标签: xamarin.forms google-play app-store


    【解决方案1】:

    这是一个已知问题,在此报告:https://github.com/edsnider/latestversionplugin/issues/6

    所以我现在使用Launcher.OpenAsync 在 AppStore 中打开应用程序。

    public async void IsLatestVersion()
    {
        var isLatest = await CrossLatestVersion.Current.IsUsingLatestVersion();
    
        if (!isLatest)
        {
            var update = await DisplayAlert("New Version", "There is a new version of this app available. Would you like to update now?", "Yes", "No");
    
            if (update)
            {
                if(Device.RuntimePlatform == TargetPlatform.iOS.ToString())
                {
                    await Launcher.OpenAsync(new Uri("App store link"));
                }
                else
                {
                    await CrossLatestVersion.Current.OpenAppInStore();
                }
            }
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-03
      • 2017-11-09
      • 2020-12-07
      • 1970-01-01
      • 2020-07-12
      • 1970-01-01
      • 2014-08-22
      相关资源
      最近更新 更多