首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AppStore应用程序页面在新版本可用时不会打开?

AppStore应用程序页面在新版本可用时不会打开?
EN

Stack Overflow用户
提问于 2020-02-01 03:12:12
回答 1查看 356关注 0票数 0

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

我的代码:

代码语言:javascript
复制
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中,如果有新版本可用,则显示警报的功能很好。在安卓应用程序中,如果从警报中点击“是”,它将在play store应用程序中加载应用程序页面。

但是对于ios,当从警报中点击“是”选项时,应用程序页将不会加载。Cannot connect to AppStore 将显示在Appstore应用程序.上。

截图:

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-04 06:48:57

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

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

代码语言:javascript
复制
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();
            }
        }
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60013659

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档