Giter Club home page Giter Club logo

versiontrackingplugin's Introduction

Version Tracking Plugin for Xamarin and Windows NuGet

Track which versions of your Xamarin.iOS, Xamarin.Mac, Xamarin.Android, or Windows app a user has previously installed.

Setup

Platform Support
Platform Version
Xamarin.iOS iOS 7+
Xamarin.Android API 10+
Windows 10 UWP 10+
Xamarin.Mac All

Supports both classic Xamarin.iOS / Xamarin.Android and Xamarin.Forms

API Usage

Call this on each app launch inside DidFinishLaunching (Xamarin.iOS), FinishedLaunching (Xamarin.Mac), or the MainActivity's OnCreate (Xamarin.Android)

CrossVersionTracking.Current.Track ();

Then call these whenever you want (in these examples the user has launched a bunch of previous versions, and this is the first time he's launched the new version 1.0.11):

var vt = CrossVersionTracking.Current;

vt.IsFirstLaunchEver;        // false
vt.IsFirstLaunchForVersion;  // true
vt.IsFirstLaunchForBuild;    // true

vt.CurrentVersion;           // 1.0.11
vt.PreviousVersion;          // 1.0.10
vt.FirstInstalledVersion;    // 1.0.0
vt.VersionHistory;           // [ 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.10, 1.0.11 ]

vt.CurrentBuild;             // 18
vt.PreviousBuild;            // 15
vt.FirstInstalledBuild;      // 1
vt.BuildHistory;             // [ 1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 15, 18 ]

Or set up actions to be called on the first lauch of a specific version or build:

var vt = CrossVersionTracking.Current;

vt.OnFirstLaunchOfBuild ("18", () => Console.WriteLine ("First time Build 18 launched!"));
vt.OnFirstLaunchOfVersion ("1.0.11", () => Console.WriteLine ("First time Version 1.0.11 launched!"));

Contributors

License

The MIT License (MIT) Copyright © 2017 Colby Williams

versiontrackingplugin's People

Contributors

aritchie avatar colbylwilliams avatar jamesmontemagno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

versiontrackingplugin's Issues

WP8 NotImplementedException

Hi,

It seems that the plugin is not working on Windows Phone 8.
I get NotImplementedException, but not the one you would think, thrown from the portable library.

I debugged it and found out that on the two platforms mentioned I get an NotImplementedException in the VersionTrackingImplementation when accessing Package.Current.
It seems that it is not implemented in the windows frameworks.

I found I workaround and I'm happy to create a PR.

Cheers

Usage with XF

I have a few questions regarding initialization of this plugin with XF:

  1. Should I initialize this plugin on every platform or just within XF Application class?
    a. If initialized within XF Application class, should I still reference this plugin on all platfroms?
    b. If initialized on every platform, should this be before or after Forms.Init();?
  2. I see this plugin is supporting UWP; where should this be initialized on UWP?

BADASS

Just dropping a note to let you know this is badass. Hope you are well, homie!

Awesome Plugin

Hi,

On my search for a stable solution to check for previous and current build versions in my Xamarin.Forms PCL App I found your plugin. I just wanna say thank you for providing such great plugin.

I use it in context of Azure Mobile Apps to detect if it is the first launch of current build and delete my SQLite DB file to overcome backend SQL Server Schema changes.

Eric

WinRT Exception

Hi,

For WinRT apps I get an exception while trying to store the versionTrail list into the app settings.
I get: "Error trying to serialize the value to be written to the application data store".

I think storing lists in the data store is not supported, so a serialization is needed.
I will add a PR with a fix.

Cheers,
Roland

UWP Track() COMException

Hi, what's the right place of CrossVersionTracking.Current.Track() in UWP Xamarin.Forms ?
I' always get this:

System.Runtime.InteropServices.COMException occurred
  HResult=0x8007065E
  Message=Data of this type is not supported.

Error trying to serialize the value to be written to the application data store
  Source=
  StackTrace:
   at System.Runtime.InteropServices.WindowsRuntime.IMap`2.Insert(K key, V value)
   at System.Runtime.InteropServices.WindowsRuntime.MapToDictionaryAdapter.Insert[K,V](IMap`2 _this, K key, V value)
   at System.Runtime.InteropServices.WindowsRuntime.MapToDictionaryAdapter.Indexer_Set[K,V](K key, V value)
   at Plugin.VersionTracking.VersionTrackingImplementation.Track()
   at Xamarin.UWP.MainPage..ctor() in C:\...\Xamarin.UWP\MainPage.xaml.cs:line 24
   at Xamarin.UWP.Xamarin_UWP_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage() in C:\...\Xamarin.UWP\obj\x86\Debug\XamlTypeInfo.g.cs:line 207
   at Xamarin.UWP.Xamarin_UWP_XamlTypeInfo.XamlUserType.ActivateInstance() in C:\...\Xamarin.UWP\obj\x86\Debug\XamlTypeInfo.g.cs:line 435

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.