Warm tip: This article is reproduced from stackoverflow.com, please click
app-store google-play xamarin.forms

Xamarin forms: AppStore app page is not opening when new version is available?

发布于 2020-04-08 23:42:27

I am using Plugin.LatestVersion NuGet package for checking new version availability.

My Code:

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();
    }
}

In android and IOS, displaying an alert is working fine if a new version is available. In the case of the android app, if tap yes from the alert it will load the app page in the play store app.

But for ios, the app page is not loading when tap yes option form the alert. Cannot connect to AppStore is showing on the Appstore app.

Screenshot:

enter image description here

I have also tried await CrossLatestVersion.Current.OpenAppInStore("app bundle name");, but showing the same above screen on AppStore.

Questioner
Sreejith Sree
Viewed
56
Sreejith Sree 2020-02-04 17:31

It's a known issue, reported here: https://github.com/edsnider/latestversionplugin/issues/6.

So I used Launcher.OpenAsync for opening the app in AppStore for now.

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();
            }
        }
    }
}