Giter VIP home page Giter VIP logo

latestversionplugin's Introduction

LatestVersion Plugin for Xamarin and Windows apps

Build Status MyGet NuGet

Easily detect if you are running the latest version of your iOS, macOS, Android, or Windows app and open it in the App Store, Play Store, or Microsoft Store to update it.

Supported platforms and versions

Platform Supported Version
Xamarin.iOS Yes 7.0+
Xamarin.Android Yes 10.0+
Xamarin.Mac Yes 10.7+
Windows (UWP) Yes 10.0+
(Target 14393+)

API Usage

Check for latest version

Check if the current running app is the latest version available in the public store:

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

Get latest version number

Get the version number of the current running app's latest version available in the public store:

string latestVersionNumber = await CrossLatestVersion.Current.GetLatestVersionNumber();

Get installed version number

Get the version number of the current app's installed version:

string installedVersionNumber = CrossLatestVersion.Current.InstalledVersionNumber;

Open app in public store

Open the current running app in the public store:

await CrossLatestVersion.Current.OpenAppInStore();

Set country code

Set the country code to be used when looking up the current app in the public store:

CrossLatestVersion.Current.CountryCode = "nz";

Notes about the CountryCode property:

  • It is optional; if not provided it will default to "us".
  • It is only needed/used on iOS.
  • If used, the value should be an alpha-2 code (ISO 3166-1).

Example

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

License

Licensed under MIT. See License file

latestversionplugin's People

Contributors

edsnider avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.