我正在使用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中,如果有新版本可用,则显示警报的功能很好。在安卓应用程序中,如果从警报中点击“是”,它将在play store应用程序中加载应用程序页面。。
但是对于ios,当从警报中点击“是”选项时,应用程序页将不会加载。Cannot connect to AppStore 将显示在Appstore应用程序.上。
截图:

我也尝试过await CrossLatestVersion.Current.OpenAppInStore("app bundle name");,但在AppStore上显示了相同的屏幕。
发布于 2020-02-04 06:48:57
这是一个已知的问题,在这里报道: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();
}
}
}
}https://stackoverflow.com/questions/60013659
复制相似问题