├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── LICENSE.md ├── README.md ├── VersionTracking.Tests.sln ├── VersionTracking.nuspec ├── VersionTracking.sln ├── VersionTracking ├── Plugin.VersionTracking.Abstractions │ ├── IVersionTracking.cs │ └── Plugin.VersionTracking.Abstractions.csproj ├── Plugin.VersionTracking.Android │ ├── Plugin.VersionTracking.Android.csproj │ ├── Plugin.VersionTracking.Android.csproj.bak │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ └── AboutResources.txt │ └── VersionTrackingImplementation.cs ├── Plugin.VersionTracking.UWP │ ├── Plugin.VersionTracking.UWP.csproj │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Plugin.VersionTracking.rd.xml │ ├── VersionTrackingImplementation.cs │ ├── project.json │ └── project.lock.json ├── Plugin.VersionTracking.iOS │ ├── Plugin.VersionTracking.iOS.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── VersionTrackingImplementation.cs ├── Plugin.VersionTracking.macOS │ ├── Plugin.VersionTracking.macOS.csproj │ └── Properties │ │ └── AssemblyInfo.cs └── Plugin.VersionTracking │ ├── CrossVersionTracking.cs │ ├── Plugin.VersionTracking.csproj │ └── Properties │ └── AssemblyInfo.cs ├── VersionTrackingTests ├── VersionTrackingTests.Android │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ ├── Tabbar.axml │ │ │ └── Toolbar.axml │ │ └── values │ │ │ └── styles.xml │ ├── VersionTrackingTests.Android.csproj │ └── packages.config ├── VersionTrackingTests.UWP │ ├── App.xaml │ ├── App.xaml.cs │ ├── Assets │ │ ├── LockScreenLogo.scale-100.png │ │ ├── LockScreenLogo.scale-125.png │ │ ├── LockScreenLogo.scale-150.png │ │ ├── LockScreenLogo.scale-200.png │ │ ├── LockScreenLogo.scale-400.png │ │ ├── SplashScreen.scale-100.png │ │ ├── SplashScreen.scale-125.png │ │ ├── SplashScreen.scale-150.png │ │ ├── SplashScreen.scale-200.png │ │ ├── SplashScreen.scale-400.png │ │ ├── Square150x150Logo.scale-200.png │ │ ├── Square44x44Logo.scale-100.png │ │ ├── Square44x44Logo.scale-125.png │ │ ├── Square44x44Logo.scale-150.png │ │ ├── Square44x44Logo.scale-200.png │ │ ├── Square44x44Logo.scale-400.png │ │ ├── Square44x44Logo.targetsize-16_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-256_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-32_altform-unplated.png │ │ ├── Square44x44Logo.targetsize-48_altform-unplated.png │ │ ├── StoreLogo.png │ │ ├── Wide310x150Logo.scale-100.png │ │ ├── Wide310x150Logo.scale-125.png │ │ ├── Wide310x150Logo.scale-150.png │ │ ├── Wide310x150Logo.scale-200.png │ │ └── Wide310x150Logo.scale-400.png │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── Package.appxmanifest │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ └── Default.rd.xml │ ├── VersionTrackingTests.UWP.csproj │ ├── VersionTrackingTests.UWP.nuget.props │ ├── VersionTrackingTests.UWP.nuget.targets │ ├── project.json │ └── project.lock.json ├── VersionTrackingTests.iOS │ ├── AppDelegate.cs │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── VersionTrackingTests.iOS.csproj │ ├── iTunesArtwork │ ├── iTunesArtwork@2x │ └── packages.config └── VersionTrackingTests │ ├── App.xaml │ ├── App.xaml.cs │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ ├── VersionTrackingTests.projitems │ └── VersionTrackingTests.shproj ├── appveyor.yml ├── build.cake ├── build.ps1 ├── build.sh ├── cake.packages.config ├── install-android-sdk.ps1 └── plugin_icon.png /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below. 2 | 3 | **Failure to fill out this information will result in this issue being closed.** If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here. 4 | 5 | ## Bug Information 6 | 7 | Version Number of Plugin: 8 | Device Tested On: 9 | Simulator Tested On: 10 | Version of VS: 11 | Version of Xamarin: 12 | Versions of other things you are using: 13 | 14 | ### Steps to reproduce the Behavior 15 | 16 | ### Expected Behavior 17 | 18 | ### Actual Behavior 19 | 20 | ### Code snippet 21 | 22 | ### Screenshots 23 | 24 | 25 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please take a moment to fill out the following: 2 | 3 | Fixes # . 4 | 5 | Changes Proposed in this pull request: 6 | - 7 | - 8 | - 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | *.userprefs 9 | 10 | .vs/ 11 | 12 | # Xamarin.Android 13 | Resource.designer.cs 14 | Resources.designer.cs 15 | 16 | # Xamarin Components 17 | Components/ 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | x64/ 24 | build/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | #NUNIT 34 | *.VisualState.xml 35 | TestResult.xml 36 | 37 | # Build Results of an ATL Project 38 | [Dd]ebugPS/ 39 | [Rr]eleasePS/ 40 | dlldata.c 41 | 42 | *_i.c 43 | *_p.c 44 | *_i.h 45 | *.ilk 46 | *.meta 47 | *.obj 48 | *.pch 49 | *.pdb 50 | *.pgc 51 | *.pgd 52 | *.rsp 53 | *.sbr 54 | *.tlb 55 | *.tli 56 | *.tlh 57 | *.tmp 58 | *.tmp_proj 59 | *.log 60 | *.vspscc 61 | *.vssscc 62 | .builds 63 | *.pidb 64 | *.svclog 65 | *.scc 66 | 67 | # Chutzpah Test files 68 | _Chutzpah* 69 | 70 | # Visual C++ cache files 71 | ipch/ 72 | *.aps 73 | *.ncb 74 | *.opensdf 75 | *.sdf 76 | *.cachefile 77 | 78 | # Visual Studio profiler 79 | *.psess 80 | *.vsp 81 | *.vspx 82 | 83 | # TFS 2012 Local Workspace 84 | $tf/ 85 | 86 | # Guidance Automation Toolkit 87 | *.gpState 88 | 89 | # ReSharper is a .NET coding add-in 90 | _ReSharper*/ 91 | *.[Rr]e[Ss]harper 92 | *.DotSettings.user 93 | 94 | # JustCode is a .NET coding addin-in 95 | .JustCode 96 | 97 | # TeamCity is a build add-in 98 | _TeamCity* 99 | 100 | 101 | # NCrunch 102 | *.ncrunch* 103 | _NCrunch_* 104 | .*crunch*.local.xml 105 | 106 | # MightyMoose 107 | *.mm.* 108 | AutoTest.Net/ 109 | 110 | # Web workbench (sass) 111 | .sass-cache/ 112 | 113 | # Installshield output folder 114 | [Ee]xpress/ 115 | 116 | # DocProject is a documentation generator add-in 117 | DocProject/buildhelp/ 118 | DocProject/Help/*.HxT 119 | DocProject/Help/*.HxC 120 | DocProject/Help/*.hhc 121 | DocProject/Help/*.hhk 122 | DocProject/Help/*.hhp 123 | DocProject/Help/Html2 124 | DocProject/Help/html 125 | 126 | # Click-Once directory 127 | publish/ 128 | 129 | # Publish Web Output 130 | *.[Pp]ublish.xml 131 | *.azurePubxml 132 | 133 | # NuGet Packages Directory 134 | packages/ 135 | ## TODO: If the tool you use requires repositories.config uncomment the next line 136 | #!packages/repositories.config 137 | 138 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 139 | # This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented) 140 | !packages/build/ 141 | 142 | # Windows Azure Build Output 143 | csx/ 144 | *.build.csdef 145 | 146 | # Windows Store app package directory 147 | AppPackages/ 148 | 149 | # Others 150 | sql/ 151 | *.Cache 152 | ClientBin/ 153 | [Ss]tyle[Cc]op.* 154 | ~$* 155 | *~ 156 | *.dbmdl 157 | *.dbproj.schemaview 158 | *.pfx 159 | *.publishsettings 160 | node_modules/ 161 | 162 | # RIA/Silverlight projects 163 | Generated_Code/ 164 | 165 | # Backup & report files from converting an old project file to a newer 166 | # Visual Studio version. Backup files are not needed, because we have git ;-) 167 | _UpgradeReport_Files/ 168 | Backup*/ 169 | UpgradeLog*.XML 170 | UpgradeLog*.htm 171 | 172 | # SQL Server files 173 | *.mdf 174 | *.ldf 175 | 176 | # Business Intelligence projects 177 | *.rdl.data 178 | *.bim.layout 179 | *.bim_*.settings 180 | 181 | # Microsoft Fakes 182 | FakesAssemblies/ 183 | 184 | # Xamarin 185 | #Autosave files 186 | *~ 187 | 188 | #build 189 | [Oo]bj/ 190 | [Bb]in/ 191 | packages/ 192 | TestResults/ 193 | 194 | # globs 195 | Makefile.in 196 | *.DS_Store 197 | *.sln.cache 198 | *.cache 199 | *.pidb 200 | *.userprefs 201 | *.usertasks 202 | config.log 203 | config.make 204 | config.status 205 | aclocal.m4 206 | install-sh 207 | autom4te.cache/ 208 | *.tar.gz 209 | tarballs/ 210 | test-results/ 211 | Thumbs.db 212 | 213 | #Mac bundle stuff 214 | *.dmg 215 | *.app 216 | 217 | #bitrise 218 | .bitrise* 219 | /.vs/config 220 | *.nupkg 221 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Colby Williams 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Version Tracking Plugin for Xamarin and Windows ![NuGet](https://img.shields.io/nuget/v/Plugin.VersionTracking.svg?label=NuGet) 2 | 3 | Track which versions of your Xamarin.iOS, Xamarin.Mac, Xamarin.Android, or Windows app a user has previously installed. 4 | 5 | ## Setup 6 | * Available on NuGet: https://www.nuget.org/packages/Plugin.VersionTracking/ 7 | * Install into your PCL/.NET Standard project and Client projects. 8 | _(fuctionality is exposed through a built-in Singleton, no dependency service required)_ 9 | 10 | 11 | ##### Platform Support 12 | 13 | |Platform|Version| 14 | | ------------------- | :------------------: | 15 | |Xamarin.iOS|iOS 7+| 16 | |Xamarin.Android|API 10+| 17 | |Windows 10 UWP|10+| 18 | |Xamarin.Mac|All| 19 | 20 | **_Supports both classic Xamarin.iOS / Xamarin.Android and Xamarin.Forms_** 21 | 22 | 23 | ## API Usage 24 | 25 | Call this on each app launch inside `DidFinishLaunching` (Xamarin.iOS), `FinishedLaunching` (Xamarin.Mac), or the MainActivity's `OnCreate` (Xamarin.Android) 26 | 27 | ```C# 28 | CrossVersionTracking.Current.Track (); 29 | ``` 30 | 31 | 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): 32 | 33 | ```C# 34 | var vt = CrossVersionTracking.Current; 35 | 36 | vt.IsFirstLaunchEver; // false 37 | vt.IsFirstLaunchForVersion; // true 38 | vt.IsFirstLaunchForBuild; // true 39 | 40 | vt.CurrentVersion; // 1.0.11 41 | vt.PreviousVersion; // 1.0.10 42 | vt.FirstInstalledVersion; // 1.0.0 43 | vt.VersionHistory; // [ 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.10, 1.0.11 ] 44 | 45 | vt.CurrentBuild; // 18 46 | vt.PreviousBuild; // 15 47 | vt.FirstInstalledBuild; // 1 48 | vt.BuildHistory; // [ 1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 15, 18 ] 49 | ``` 50 | 51 | Or set up actions to be called on the first lauch of a specific version or build: 52 | 53 | ```C# 54 | var vt = CrossVersionTracking.Current; 55 | 56 | vt.OnFirstLaunchOfBuild ("18", () => Console.WriteLine ("First time Build 18 launched!")); 57 | vt.OnFirstLaunchOfVersion ("1.0.11", () => Console.WriteLine ("First time Version 1.0.11 launched!")); 58 | ``` 59 | 60 | 61 | ## Contributors 62 | * [Colby Williams](https://github.com/colbylwilliams) 63 | * _Originally inspired by [GBVersionTracking](https://github.com/lmirosevic/GBVersionTracking)_ 64 | 65 | 66 | #### License 67 | The MIT License (MIT) 68 | Copyright © 2017 Colby Williams 69 | -------------------------------------------------------------------------------- /VersionTracking.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Plugin.VersionTracking 5 | $version 6 | Version Tracking Plugin for Xamarin and Windows - Official 7 | Colby Williams, James Montemagno 8 | Colby Williams, James Montemagno 9 | https://github.com/colbylwilliams/VersionTrackingPlugin/blob/master/LICENSE.md 10 | https://github.com/colbylwilliams/VersionTrackingPlugin 11 | https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/master/plugin_icon.png 12 | false 13 | 14 | Official Plugin - Track which versions of your Xamarin.iOS, Xamarin.Mac, Xamarin.Android, or Windows app a user has previously installed. 15 | 16 | App Version Tracking Plugin for Xamarin and Windows 17 | xamarin, pcl, xam.pcl, plugin, plugin for xamarin, windows phone, winphone, wp8, winrt, android, xamarin.forms, ios, mac, version 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /VersionTracking.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26923.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.VersionTracking", "VersionTracking\Plugin.VersionTracking\Plugin.VersionTracking.csproj", "{A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.VersionTracking.Abstractions", "VersionTracking\Plugin.VersionTracking.Abstractions\Plugin.VersionTracking.Abstractions.csproj", "{6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.VersionTracking.iOS", "VersionTracking\Plugin.VersionTracking.iOS\Plugin.VersionTracking.iOS.csproj", "{2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.VersionTracking.Android", "VersionTracking\Plugin.VersionTracking.Android\Plugin.VersionTracking.Android.csproj", "{56A56F17-7DE1-4CA1-9617-BF32E971AC84}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.VersionTracking.UWP", "VersionTracking\Plugin.VersionTracking.UWP\Plugin.VersionTracking.UWP.csproj", "{E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.VersionTracking.macOS", "VersionTracking\Plugin.VersionTracking.macOS\Plugin.VersionTracking.macOS.csproj", "{C5EC8220-E27E-4382-808D-991328F0547F}" 17 | EndProject 18 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{190E3A3D-733C-420D-A983-F1EE21FADE77}" 19 | ProjectSection(SolutionItems) = preProject 20 | appveyor.yml = appveyor.yml 21 | build.cake = build.cake 22 | build.ps1 = build.ps1 23 | build.sh = build.sh 24 | cake.packages.config = cake.packages.config 25 | LICENSE.md = LICENSE.md 26 | README.md = README.md 27 | VersionTracking.nuspec = VersionTracking.nuspec 28 | EndProjectSection 29 | EndProject 30 | Global 31 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 32 | Debug|Any CPU = Debug|Any CPU 33 | Debug|ARM = Debug|ARM 34 | Debug|x64 = Debug|x64 35 | Debug|x86 = Debug|x86 36 | Release|Any CPU = Release|Any CPU 37 | Release|ARM = Release|ARM 38 | Release|x64 = Release|x64 39 | Release|x86 = Release|x86 40 | EndGlobalSection 41 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 42 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|ARM.ActiveCfg = Debug|Any CPU 45 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|ARM.Build.0 = Debug|Any CPU 46 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|x64.ActiveCfg = Debug|Any CPU 47 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|x64.Build.0 = Debug|Any CPU 48 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|x86.ActiveCfg = Debug|Any CPU 49 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Debug|x86.Build.0 = Debug|Any CPU 50 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|ARM.ActiveCfg = Release|Any CPU 53 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|ARM.Build.0 = Release|Any CPU 54 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|x64.ActiveCfg = Release|Any CPU 55 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|x64.Build.0 = Release|Any CPU 56 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|x86.ActiveCfg = Release|Any CPU 57 | {A6FCEF44-D2BA-42C7-B3CB-13667BCD7B54}.Release|x86.Build.0 = Release|Any CPU 58 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 59 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|Any CPU.Build.0 = Debug|Any CPU 60 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|ARM.ActiveCfg = Debug|Any CPU 61 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|ARM.Build.0 = Debug|Any CPU 62 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|x64.ActiveCfg = Debug|Any CPU 63 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|x64.Build.0 = Debug|Any CPU 64 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|x86.ActiveCfg = Debug|Any CPU 65 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Debug|x86.Build.0 = Debug|Any CPU 66 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|Any CPU.ActiveCfg = Release|Any CPU 67 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|Any CPU.Build.0 = Release|Any CPU 68 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|ARM.ActiveCfg = Release|Any CPU 69 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|ARM.Build.0 = Release|Any CPU 70 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|x64.ActiveCfg = Release|Any CPU 71 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|x64.Build.0 = Release|Any CPU 72 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|x86.ActiveCfg = Release|Any CPU 73 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D}.Release|x86.Build.0 = Release|Any CPU 74 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 75 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|Any CPU.Build.0 = Debug|Any CPU 76 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|ARM.ActiveCfg = Debug|Any CPU 77 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|ARM.Build.0 = Debug|Any CPU 78 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|x64.ActiveCfg = Debug|Any CPU 79 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|x64.Build.0 = Debug|Any CPU 80 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|x86.ActiveCfg = Debug|Any CPU 81 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Debug|x86.Build.0 = Debug|Any CPU 82 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|Any CPU.ActiveCfg = Release|Any CPU 83 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|Any CPU.Build.0 = Release|Any CPU 84 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|ARM.ActiveCfg = Release|Any CPU 85 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|ARM.Build.0 = Release|Any CPU 86 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|x64.ActiveCfg = Release|Any CPU 87 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|x64.Build.0 = Release|Any CPU 88 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|x86.ActiveCfg = Release|Any CPU 89 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0}.Release|x86.Build.0 = Release|Any CPU 90 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 91 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|Any CPU.Build.0 = Debug|Any CPU 92 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|ARM.ActiveCfg = Debug|Any CPU 93 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|ARM.Build.0 = Debug|Any CPU 94 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|x64.ActiveCfg = Debug|Any CPU 95 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|x64.Build.0 = Debug|Any CPU 96 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|x86.ActiveCfg = Debug|Any CPU 97 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Debug|x86.Build.0 = Debug|Any CPU 98 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|Any CPU.ActiveCfg = Release|Any CPU 99 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|Any CPU.Build.0 = Release|Any CPU 100 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|ARM.ActiveCfg = Release|Any CPU 101 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|ARM.Build.0 = Release|Any CPU 102 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|x64.ActiveCfg = Release|Any CPU 103 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|x64.Build.0 = Release|Any CPU 104 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|x86.ActiveCfg = Release|Any CPU 105 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84}.Release|x86.Build.0 = Release|Any CPU 106 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 107 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU 108 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|ARM.ActiveCfg = Debug|ARM 109 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|ARM.Build.0 = Debug|ARM 110 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|x64.ActiveCfg = Debug|x64 111 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|x64.Build.0 = Debug|x64 112 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|x86.ActiveCfg = Debug|x86 113 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Debug|x86.Build.0 = Debug|x86 114 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU 115 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|Any CPU.Build.0 = Release|Any CPU 116 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|ARM.ActiveCfg = Release|ARM 117 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|ARM.Build.0 = Release|ARM 118 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|x64.ActiveCfg = Release|x64 119 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|x64.Build.0 = Release|x64 120 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|x86.ActiveCfg = Release|x86 121 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1}.Release|x86.Build.0 = Release|x86 122 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 123 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|Any CPU.Build.0 = Debug|Any CPU 124 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|ARM.ActiveCfg = Debug|Any CPU 125 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|ARM.Build.0 = Debug|Any CPU 126 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|x64.ActiveCfg = Debug|Any CPU 127 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|x64.Build.0 = Debug|Any CPU 128 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|x86.ActiveCfg = Debug|Any CPU 129 | {C5EC8220-E27E-4382-808D-991328F0547F}.Debug|x86.Build.0 = Debug|Any CPU 130 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|Any CPU.ActiveCfg = Release|Any CPU 131 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|Any CPU.Build.0 = Release|Any CPU 132 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|ARM.ActiveCfg = Release|Any CPU 133 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|ARM.Build.0 = Release|Any CPU 134 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|x64.ActiveCfg = Release|Any CPU 135 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|x64.Build.0 = Release|Any CPU 136 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|x86.ActiveCfg = Release|Any CPU 137 | {C5EC8220-E27E-4382-808D-991328F0547F}.Release|x86.Build.0 = Release|Any CPU 138 | EndGlobalSection 139 | GlobalSection(SolutionProperties) = preSolution 140 | HideSolutionNode = FALSE 141 | EndGlobalSection 142 | GlobalSection(ExtensibilityGlobals) = postSolution 143 | SolutionGuid = {98B507DE-83FB-4E9E-A638-F0A8909D3868} 144 | EndGlobalSection 145 | EndGlobal 146 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Abstractions/IVersionTracking.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Plugin.VersionTracking.Abstractions 5 | { 6 | /// 7 | /// Interface for VersionTracking 8 | /// 9 | public interface IVersionTracking 10 | { 11 | /// 12 | /// Call this as the VERY FIRST THING in FinishedLaunching 13 | /// 14 | void Track(); 15 | 16 | /// 17 | /// Check if this is the first time ever that the app is launched. 18 | /// 19 | /// The is first launch ever. 20 | bool IsFirstLaunchEver { get; } 21 | 22 | 23 | /// 24 | /// Check if this is the first time that this particular version is being launched. 25 | /// 26 | /// The is first launch for current version. 27 | bool IsFirstLaunchForVersion { get; } 28 | 29 | 30 | /// 31 | /// Check if this is the first time that this particular build is being launched. 32 | /// 33 | /// The is first launch for current build. 34 | bool IsFirstLaunchForBuild { get; } 35 | 36 | 37 | /// 38 | /// Returns the current version of the app, as defined in the PList, e.g. "4.3". 39 | /// 40 | /// The current version. 41 | string CurrentVersion { get; } 42 | 43 | 44 | /// 45 | /// Returns the current build of the app, as defined in the PList, e.g. "4300". 46 | /// 47 | /// The current build. 48 | string CurrentBuild { get; } 49 | 50 | 51 | /// 52 | /// Returns the previous version of the app, e.g. "4.3". 53 | /// 54 | /// The previous version. 55 | string PreviousVersion { get; } 56 | 57 | 58 | /// 59 | /// Returns the previous build of the app, "4300". 60 | /// 61 | /// The previous build. 62 | string PreviousBuild { get; } 63 | 64 | 65 | /// 66 | /// Returns the version which the user first installed the app. 67 | /// 68 | /// The first installed version. 69 | string FirstInstalledVersion { get; } 70 | 71 | 72 | /// 73 | /// Returns the build which the user first installed the app. 74 | /// 75 | /// The first installed build. 76 | string FirstInstalledBuild { get; } 77 | 78 | 79 | /// 80 | /// Returns a List of versions which the user has had installed, e.g. ["3.5", "4.0", "4.1"]. 81 | /// The List is ordered from first version installed to (including) the current version 82 | /// 83 | /// The version history. 84 | List VersionHistory { get; } 85 | 86 | 87 | /// 88 | /// Returns a List of builds which the user has had installed, e.g. ["3500", "4000", "4100"]. 89 | /// The List is ordered from first build installed to (including) the current build 90 | /// 91 | /// The build history. 92 | List BuildHistory { get; } 93 | 94 | 95 | /// 96 | /// Check if this is the first launch for a particular version number. 97 | /// Useful if you want to execute some code for first time launches of a particular version 98 | /// (like db migrations?). 99 | /// 100 | /// The first launch for version. 101 | /// Version. 102 | bool FirstLaunchForVersion(string version); 103 | 104 | 105 | /// 106 | /// Check if this is the first launch for a particular build number. 107 | /// Useful if you want to execute some code for first time launches of a particular version 108 | /// (like db migrations?). 109 | /// 110 | /// The first launch for build. 111 | /// Build. 112 | bool FirstLaunchForBuild(string build); 113 | 114 | 115 | /// 116 | /// Calls block if the condition is satisfied that the current version matches `version`, 117 | /// and this is the first time this app version is being launched. 118 | /// 119 | /// The first launch of version. 120 | /// Version. 121 | /// Block. 122 | void OnFirstLaunchOfVersion(string version, Action block); 123 | 124 | 125 | /// 126 | /// Calls block if the condition is satisfied that the current build matches `build`, 127 | /// and this is the first time this app build is being launched. 128 | /// 129 | /// The first launch of build. 130 | /// Build. 131 | /// Block. 132 | void OnFirstLaunchOfBuild(string build, Action block); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Abstractions/Plugin.VersionTracking.Abstractions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.0 5 | 1.0.0.0 6 | 1.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Android/Plugin.VersionTracking.Android.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | Plugin.VersionTracking 13 | Plugin.VersionTracking 14 | 512 15 | Resources\Resource.Designer.cs 16 | Off 17 | false 18 | True 19 | v6.0 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | bin\Release\Plugin.VersionTracking.XML 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | CrossVersionTracking.cs 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 61 | Plugin.VersionTracking.Abstractions 62 | 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Android/Plugin.VersionTracking.Android.csproj.bak: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {56A56F17-7DE1-4CA1-9617-BF32E971AC84} 9 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Properties 12 | Plugin.VersionTracking 13 | Plugin.VersionTracking 14 | 512 15 | Resources\Resource.Designer.cs 16 | Off 17 | True 18 | True 19 | v6.0 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | bin\Release\Plugin.VersionTracking.XML 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | CrossVersionTracking.cs 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 61 | Plugin.VersionTracking.Abstractions 62 | 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Plugin.VersionTracking.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany ("Colby Williams")] 13 | [assembly: AssemblyProduct("Plugin.VersionTracking.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2016 Colby Williams")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.Android/VersionTrackingImplementation.cs: -------------------------------------------------------------------------------- 1 | using Plugin.VersionTracking.Abstractions; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | using Android.App; 9 | using Android.Content.PM; 10 | using Android.Preferences; 11 | 12 | namespace Plugin.VersionTracking 13 | { 14 | /// 15 | /// Implementation for Feature 16 | /// 17 | public class VersionTrackingImplementation : IVersionTracking 18 | { 19 | Dictionary> versionTrail; 20 | 21 | bool isFirstLaunchEver; 22 | bool isFirstLaunchForVersion; 23 | bool isFirstLaunchForBuild; 24 | 25 | const string xamUserDefaultsVersionTrailKey = @"xamVersionTrail"; 26 | const string xamVersionsKey = @"xamVersion"; 27 | const string xamBuildsKey = @"xamBuild"; 28 | 29 | 30 | /// 31 | /// Call this as the VERY FIRST THING in FinishedLaunching 32 | /// 33 | public void Track() 34 | { 35 | var needsSync = false; 36 | 37 | // load history 38 | using (var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(Application.Context)) { 39 | 40 | var oldVersionList = sharedPreferences.GetStringSet(xamVersionsKey, null); 41 | 42 | var oldBuildList = sharedPreferences.GetStringSet(xamBuildsKey, null); 43 | 44 | if (oldVersionList == null || oldBuildList == null) { 45 | 46 | isFirstLaunchEver = true; 47 | 48 | versionTrail = new Dictionary> { 49 | { xamVersionsKey, new List() }, 50 | { xamBuildsKey, new List() } 51 | }; 52 | 53 | } else { 54 | 55 | versionTrail = new Dictionary> { 56 | { xamVersionsKey, oldVersionList.ToList() }, 57 | { xamBuildsKey, oldBuildList.ToList() } 58 | }; 59 | 60 | isFirstLaunchEver = false; 61 | 62 | needsSync = true; 63 | } 64 | } 65 | 66 | //check if this version was previously launched 67 | if (versionTrail[xamVersionsKey].Contains(CurrentVersion)) { 68 | 69 | isFirstLaunchForVersion = false; 70 | 71 | } else { 72 | 73 | isFirstLaunchForVersion = true; 74 | 75 | versionTrail[xamVersionsKey].Add(CurrentVersion); 76 | 77 | needsSync = true; 78 | } 79 | 80 | //check if this build was previously launched 81 | if (versionTrail[xamBuildsKey].Contains(CurrentBuild)) { 82 | 83 | isFirstLaunchForBuild = false; 84 | 85 | } else { 86 | 87 | isFirstLaunchForBuild = true; 88 | 89 | versionTrail[xamBuildsKey].Add(CurrentBuild); 90 | 91 | needsSync = true; 92 | } 93 | 94 | //store the new version stuff 95 | if (needsSync) { 96 | 97 | using (var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(Application.Context)) { 98 | 99 | using (var sharedPreferencesEditor = sharedPreferences.Edit()) { 100 | 101 | sharedPreferencesEditor.PutStringSet(xamVersionsKey, versionTrail[xamVersionsKey]); 102 | sharedPreferencesEditor.PutStringSet(xamBuildsKey, versionTrail[xamBuildsKey]); 103 | sharedPreferencesEditor.Commit(); 104 | } 105 | } 106 | } 107 | } 108 | 109 | 110 | /// 111 | /// Check if this is the first time ever that the app is launched. 112 | /// 113 | /// The is first launch ever. 114 | public bool IsFirstLaunchEver => isFirstLaunchEver; 115 | 116 | 117 | /// 118 | /// Check if this is the first time that this particular version is being launched. 119 | /// 120 | /// The is first launch for current version. 121 | public bool IsFirstLaunchForVersion => isFirstLaunchForVersion; 122 | 123 | 124 | /// 125 | /// Check if this is the first time that this particular build is being launched. 126 | /// 127 | /// The is first launch for current build. 128 | public bool IsFirstLaunchForBuild => isFirstLaunchForBuild; 129 | 130 | 131 | /// 132 | /// Returns the current version of the app, as defined in the metadata, e.g. "4.3". 133 | /// 134 | /// The current version. 135 | public string CurrentVersion { 136 | get { 137 | using (var pInfo = Application.Context.PackageManager.GetPackageInfo(Application.Context.PackageName, PackageInfoFlags.MetaData)) 138 | return pInfo.VersionName; 139 | } 140 | } 141 | 142 | 143 | /// 144 | /// Returns the current build of the app, as defined in the metadata, e.g. "4300". 145 | /// 146 | /// The current build. 147 | public string CurrentBuild { 148 | get { 149 | using (var pInfo = Application.Context.PackageManager.GetPackageInfo(Application.Context.PackageName, PackageInfoFlags.MetaData)) 150 | return pInfo.VersionCode.ToString(); 151 | } 152 | } 153 | 154 | 155 | /// 156 | /// Returns the previous version of the app, e.g. "4.3". 157 | /// 158 | /// The previous version. 159 | public string PreviousVersion { 160 | get { 161 | 162 | var count = versionTrail?[xamVersionsKey]?.Count ?? 0; 163 | 164 | return (count >= 2) ? versionTrail[xamVersionsKey][count - 2] : null; 165 | } 166 | } 167 | 168 | 169 | /// 170 | /// Returns the previous build of the app, "4300". 171 | /// 172 | /// The previous build. 173 | public string PreviousBuild { 174 | get { 175 | 176 | var count = versionTrail?[xamBuildsKey]?.Count ?? 0; 177 | 178 | return (count >= 2) ? versionTrail[xamBuildsKey][count - 2] : null; 179 | } 180 | } 181 | 182 | 183 | /// 184 | /// Returns the version which the user first installed the app. 185 | /// 186 | /// The first installed version. 187 | public string FirstInstalledVersion => versionTrail?[xamVersionsKey]?.FirstOrDefault(); 188 | 189 | 190 | /// 191 | /// Returns the build which the user first installed the app. 192 | /// 193 | /// The first installed build. 194 | public string FirstInstalledBuild => versionTrail?[xamBuildsKey]?.FirstOrDefault(); 195 | 196 | 197 | /// 198 | /// Returns a List of versions which the user has had installed, e.g. ["3.5", "4.0", "4.1"]. 199 | /// The List is ordered from first version installed to (including) the current version 200 | /// 201 | /// The version history. 202 | public List VersionHistory => versionTrail?[xamVersionsKey] ?? new List(); 203 | 204 | 205 | /// 206 | /// Returns a List of builds which the user has had installed, e.g. ["3500", "4000", "4100"]. 207 | /// The List is ordered from first build installed to (including) the current build 208 | /// 209 | /// The build history. 210 | public List BuildHistory => versionTrail?[xamBuildsKey] ?? new List(); 211 | 212 | 213 | /// 214 | /// Check if this is the first launch for a particular version number. 215 | /// Useful if you want to execute some code for first time launches of a particular version 216 | /// (like db migrations?). 217 | /// 218 | /// The first launch for version. 219 | /// Version. 220 | public bool FirstLaunchForVersion(string version) => 221 | (CurrentVersion.Equals(version, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForVersion; 222 | 223 | 224 | /// 225 | /// Check if this is the first launch for a particular build number. 226 | /// Useful if you want to execute some code for first time launches of a particular version 227 | /// (like db migrations?). 228 | /// 229 | /// The first launch for build. 230 | /// Build. 231 | public bool FirstLaunchForBuild(string build) => 232 | (CurrentBuild.Equals(build, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForBuild; 233 | 234 | 235 | 236 | /// 237 | /// Calls block if the condition is satisfied that the current version matches `version`, 238 | /// and this is the first time this app version is being launched. 239 | /// 240 | /// The first launch of version. 241 | /// Version. 242 | /// Block. 243 | public void OnFirstLaunchOfVersion(string version, Action block) 244 | { 245 | if (FirstLaunchForVersion(version)) block?.Invoke(); 246 | } 247 | 248 | 249 | /// 250 | /// Calls block if the condition is satisfied that the current build matches `build`, 251 | /// and this is the first time this app build is being launched. 252 | /// 253 | /// The first launch of build. 254 | /// Build. 255 | /// Block. 256 | public void OnFirstLaunchOfBuild(string build, Action block) 257 | { 258 | if (FirstLaunchForBuild(build)) block?.Invoke(); 259 | } 260 | 261 | /// 262 | /// Output to string 263 | /// 264 | /// 265 | public override string ToString() 266 | { 267 | var sb = new StringBuilder(); 268 | sb.AppendLine(); 269 | sb.AppendLine("VersionTracking"); 270 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchEver".PadRight(25), IsFirstLaunchEver); 271 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForVersion".PadRight(25), IsFirstLaunchForVersion); 272 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForBuild".PadRight(25), IsFirstLaunchForBuild); 273 | sb.AppendFormat(" {0}{1}\n", "CurrentVersion".PadRight(25), CurrentVersion); 274 | sb.AppendFormat(" {0}{1}\n", "PreviousVersion".PadRight(25), PreviousVersion); 275 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledVersion".PadRight(25), FirstInstalledVersion); 276 | sb.AppendFormat(" {0}[ {1} ]\n", "VersionHistory".PadRight(25), string.Join(", ", VersionHistory)); 277 | sb.AppendFormat(" {0}{1}\n", "CurrentBuild".PadRight(25), CurrentBuild); 278 | sb.AppendFormat(" {0}{1}\n", "PreviousBuild".PadRight(25), PreviousBuild); 279 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledBuild".PadRight(25), FirstInstalledBuild); 280 | sb.AppendFormat(" {0}[ {1} ]\n", "BuildHistory".PadRight(25), string.Join(", ", BuildHistory)); 281 | return sb.ToString(); 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.UWP/Plugin.VersionTracking.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {E34B516D-C0D8-450F-9DB0-BB6A5B04AEF1} 8 | Library 9 | Properties 10 | Plugin.VersionTracking 11 | Plugin.VersionTracking 12 | en-US 13 | UAP 14 | 10.0.10586.0 15 | 10.0.10240.0 16 | 14 17 | 512 18 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 19 | 20 | 21 | AnyCPU 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 27 | prompt 28 | 4 29 | 30 | 31 | AnyCPU 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_UWP 36 | prompt 37 | 4 38 | bin\Release\Plugin.VersionTracking.XML 39 | 40 | 41 | x86 42 | true 43 | bin\x86\Debug\ 44 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 45 | ;2008 46 | full 47 | x86 48 | false 49 | prompt 50 | 51 | 52 | x86 53 | bin\Release\ 54 | TRACE;NETFX_CORE;WINDOWS_UWP 55 | true 56 | ;2008 57 | pdbonly 58 | x86 59 | false 60 | prompt 61 | bin\Release\Plugin.VersionTracking.XML 62 | 63 | 64 | ARM 65 | true 66 | bin\ARM\Debug\ 67 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 68 | ;2008 69 | full 70 | ARM 71 | false 72 | prompt 73 | 74 | 75 | ARM 76 | bin\ARM\Release\ 77 | TRACE;NETFX_CORE;WINDOWS_UWP 78 | true 79 | ;2008 80 | pdbonly 81 | ARM 82 | false 83 | prompt 84 | 85 | 86 | x64 87 | true 88 | bin\x64\Debug\ 89 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 90 | ;2008 91 | full 92 | x64 93 | false 94 | prompt 95 | 96 | 97 | x64 98 | bin\x64\Release\ 99 | TRACE;NETFX_CORE;WINDOWS_UWP 100 | true 101 | ;2008 102 | pdbonly 103 | x64 104 | false 105 | prompt 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | CrossVersionTracking.cs 114 | 115 | 116 | 117 | 118 | Always 119 | 120 | 121 | 122 | 123 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 124 | Plugin.VersionTracking.Abstractions 125 | 126 | 127 | 128 | 14.0 129 | 130 | 131 | 138 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Plugin.VersionTracking.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany ("Colby Williams")] 12 | [assembly: AssemblyProduct("Plugin.VersionTracking.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2016 Colby Williams")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.UWP/Properties/Plugin.VersionTracking.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.UWP/VersionTrackingImplementation.cs: -------------------------------------------------------------------------------- 1 | using Plugin.VersionTracking.Abstractions; 2 | 3 | using System; 4 | using System.Linq; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | using Windows.ApplicationModel; 9 | using Windows.Storage; 10 | 11 | 12 | namespace Plugin.VersionTracking 13 | { 14 | /// 15 | /// Implementation for VersionTracking 16 | /// 17 | public class VersionTrackingImplementation : IVersionTracking 18 | { 19 | 20 | private static ApplicationDataContainer AppSettings { 21 | get { return ApplicationData.Current.LocalSettings; } 22 | } 23 | 24 | private readonly object locker = new object(); 25 | 26 | Dictionary> versionTrail; 27 | 28 | bool isFirstLaunchEver; 29 | bool isFirstLaunchForVersion; 30 | bool isFirstLaunchForBuild; 31 | 32 | const string xamUserDefaultsVersionTrailKey = @"xamVersionTrail"; 33 | const string xamVersionsKey = @"xamVersion"; 34 | const string xamBuildsKey = @"xamBuild"; 35 | 36 | 37 | /// 38 | /// Call this as the VERY FIRST THING in FinishedLaunching 39 | /// 40 | public void Track() 41 | { 42 | var needsSync = false; 43 | 44 | // load history 45 | 46 | var noValues = (!AppSettings.Values.ContainsKey(xamVersionsKey) || !AppSettings.Values.ContainsKey(xamBuildsKey)); 47 | 48 | if (noValues) { 49 | 50 | isFirstLaunchEver = true; 51 | 52 | versionTrail = new Dictionary> { 53 | { xamVersionsKey, new List() }, 54 | { xamBuildsKey, new List() } 55 | }; 56 | 57 | } else { 58 | 59 | 60 | var oldVersionList = (AppSettings.Values[xamVersionsKey] as string)?.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List(); 61 | 62 | var oldBuildList = (AppSettings.Values[xamBuildsKey] as string)?.Split(new[] { '|' }, StringSplitOptions.RemoveEmptyEntries).ToList() ?? new List(); 63 | 64 | versionTrail = new Dictionary> { 65 | { xamVersionsKey, oldVersionList }, 66 | { xamBuildsKey, oldBuildList } 67 | }; 68 | 69 | isFirstLaunchEver = false; 70 | 71 | needsSync = true; 72 | } 73 | 74 | 75 | //check if this version was previously launched 76 | if (versionTrail[xamVersionsKey].Contains(CurrentVersion)) { 77 | 78 | isFirstLaunchForVersion = false; 79 | 80 | } else { 81 | 82 | isFirstLaunchForVersion = true; 83 | 84 | versionTrail[xamVersionsKey].Add(CurrentVersion); 85 | 86 | needsSync = true; 87 | } 88 | 89 | //check if this build was previously launched 90 | if (versionTrail[xamBuildsKey].Contains(CurrentBuild)) { 91 | 92 | isFirstLaunchForBuild = false; 93 | 94 | } else { 95 | 96 | isFirstLaunchForBuild = true; 97 | 98 | versionTrail[xamBuildsKey].Add(CurrentBuild); 99 | 100 | needsSync = true; 101 | } 102 | 103 | //store the new version stuff 104 | if (needsSync) { 105 | 106 | lock (locker) { 107 | 108 | if (!AppSettings.Values.ContainsKey(xamVersionsKey)) { 109 | AppSettings.CreateContainer(xamVersionsKey, ApplicationDataCreateDisposition.Always); 110 | } 111 | if (AppSettings.Values.ContainsKey(xamBuildsKey)) { 112 | AppSettings.CreateContainer(xamBuildsKey, ApplicationDataCreateDisposition.Always); 113 | } 114 | 115 | AppSettings.Values[xamVersionsKey] = String.Join("|", versionTrail[xamVersionsKey]); 116 | AppSettings.Values[xamBuildsKey] = String.Join("|", versionTrail[xamBuildsKey]); 117 | } 118 | } 119 | } 120 | 121 | 122 | /// 123 | /// Check if this is the first time ever that the app is launched. 124 | /// 125 | /// The is first launch ever. 126 | public bool IsFirstLaunchEver => isFirstLaunchEver; 127 | 128 | 129 | /// 130 | /// Check if this is the first time that this particular version is being launched. 131 | /// 132 | /// The is first launch for current version. 133 | public bool IsFirstLaunchForVersion => isFirstLaunchForVersion; 134 | 135 | 136 | /// 137 | /// Check if this is the first time that this particular build is being launched. 138 | /// 139 | /// The is first launch for current build. 140 | public bool IsFirstLaunchForBuild => isFirstLaunchForBuild; 141 | 142 | 143 | /// 144 | /// Returns the current version of the app, as defined in the PList, e.g. "4.3". 145 | /// 146 | /// The current version. 147 | public string CurrentVersion { 148 | get { 149 | var version = Package.Current.Id.Version; 150 | 151 | return string.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Build, version.Revision); 152 | } 153 | } 154 | 155 | 156 | /// 157 | /// Returns the current build of the app, as defined in the PList, e.g. "4300". 158 | /// 159 | /// The current build. 160 | public string CurrentBuild => Package.Current.Id.Version.Build.ToString(); 161 | 162 | 163 | /// 164 | /// Returns the previous version of the app, e.g. "4.3". 165 | /// 166 | /// The previous version. 167 | public string PreviousVersion { 168 | get { 169 | 170 | var count = versionTrail?[xamVersionsKey]?.Count ?? 0; 171 | 172 | return (count >= 2) ? versionTrail[xamVersionsKey][count - 2] : null; 173 | } 174 | } 175 | 176 | 177 | /// 178 | /// Returns the previous build of the app, "4300". 179 | /// 180 | /// The previous build. 181 | public string PreviousBuild { 182 | get { 183 | 184 | var count = versionTrail?[xamBuildsKey]?.Count ?? 0; 185 | 186 | return (count >= 2) ? versionTrail[xamBuildsKey][count - 2] : null; 187 | } 188 | } 189 | 190 | 191 | /// 192 | /// Returns the version which the user first installed the app. 193 | /// 194 | /// The first installed version. 195 | public string FirstInstalledVersion => versionTrail?[xamVersionsKey]?.FirstOrDefault(); 196 | 197 | 198 | /// 199 | /// Returns the build which the user first installed the app. 200 | /// 201 | /// The first installed build. 202 | public string FirstInstalledBuild => versionTrail?[xamBuildsKey]?.FirstOrDefault(); 203 | 204 | 205 | /// 206 | /// Returns a List of versions which the user has had installed, e.g. ["3.5", "4.0", "4.1"]. 207 | /// The List is ordered from first version installed to (including) the current version 208 | /// 209 | /// The version history. 210 | public List VersionHistory => versionTrail?[xamVersionsKey] ?? new List(); 211 | 212 | 213 | /// 214 | /// Returns a List of builds which the user has had installed, e.g. ["3500", "4000", "4100"]. 215 | /// The List is ordered from first build installed to (including) the current build 216 | /// 217 | /// The build history. 218 | public List BuildHistory => versionTrail?[xamBuildsKey] ?? new List(); 219 | 220 | 221 | /// 222 | /// Check if this is the first launch for a particular version number. 223 | /// Useful if you want to execute some code for first time launches of a particular version 224 | /// (like db migrations?). 225 | /// 226 | /// The first launch for version. 227 | /// Version. 228 | public bool FirstLaunchForVersion(string version) => 229 | (CurrentVersion.Equals(version, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForVersion; 230 | 231 | 232 | /// 233 | /// Check if this is the first launch for a particular build number. 234 | /// Useful if you want to execute some code for first time launches of a particular version 235 | /// (like db migrations?). 236 | /// 237 | /// The first launch for build. 238 | /// Build. 239 | public bool FirstLaunchForBuild(string build) => 240 | (CurrentBuild.Equals(build, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForBuild; 241 | 242 | 243 | /// 244 | /// Calls block if the condition is satisfied that the current version matches `version`, 245 | /// and this is the first time this app version is being launched. 246 | /// 247 | /// The first launch of version. 248 | /// Version. 249 | /// Block. 250 | public void OnFirstLaunchOfVersion(string version, Action block) 251 | { 252 | if (FirstLaunchForVersion(version)) block?.Invoke(); 253 | } 254 | 255 | 256 | /// 257 | /// Calls block if the condition is satisfied that the current build matches `build`, 258 | /// and this is the first time this app build is being launched. 259 | /// 260 | /// The first launch of build. 261 | /// Build. 262 | /// Block. 263 | public void OnFirstLaunchOfBuild(string build, Action block) 264 | { 265 | if (FirstLaunchForBuild(build)) block?.Invoke(); 266 | } 267 | 268 | /// 269 | /// Output to string 270 | /// 271 | /// 272 | public override string ToString() 273 | { 274 | var sb = new StringBuilder(); 275 | sb.AppendLine(); 276 | sb.AppendLine("VersionTracking"); 277 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchEver".PadRight(25), IsFirstLaunchEver); 278 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForVersion".PadRight(25), IsFirstLaunchForVersion); 279 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForBuild".PadRight(25), IsFirstLaunchForBuild); 280 | sb.AppendFormat(" {0}{1}\n", "CurrentVersion".PadRight(25), CurrentVersion); 281 | sb.AppendFormat(" {0}{1}\n", "PreviousVersion".PadRight(25), PreviousVersion); 282 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledVersion".PadRight(25), FirstInstalledVersion); 283 | sb.AppendFormat(" {0}[ {1} ]\n", "VersionHistory".PadRight(25), string.Join(", ", VersionHistory)); 284 | sb.AppendFormat(" {0}{1}\n", "CurrentBuild".PadRight(25), CurrentBuild); 285 | sb.AppendFormat(" {0}{1}\n", "PreviousBuild".PadRight(25), PreviousBuild); 286 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledBuild".PadRight(25), FirstInstalledBuild); 287 | sb.AppendFormat(" {0}[ {1} ]\n", "BuildHistory".PadRight(25), string.Join(", ", BuildHistory)); 288 | return sb.ToString(); 289 | } 290 | } 291 | } -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.3" 4 | }, 5 | "frameworks": { 6 | "uap10.0.10240": {} 7 | }, 8 | "runtimes": { 9 | "win10-arm": {}, 10 | "win10-arm-aot": {}, 11 | "win10-x86": {}, 12 | "win10-x86-aot": {}, 13 | "win10-x64": {}, 14 | "win10-x64-aot": {} 15 | } 16 | } -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.iOS/Plugin.VersionTracking.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {2882AEEB-D4CD-4EB9-8A6C-6653B33681F0} 9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10 | Library 11 | Plugin.VersionTracking 12 | Resources 13 | Plugin.VersionTracking 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\iPhone\Debug 20 | DEBUG 21 | prompt 22 | 4 23 | false 24 | true 25 | iPhone Developer 26 | 27 | 28 | none 29 | true 30 | bin\iPhone\Release 31 | prompt 32 | 4 33 | false 34 | iPhone Developer 35 | bin\iPhone\Release\Plugin.VersionTracking.XML 36 | 37 | 38 | 39 | CrossVersionTracking.cs 40 | 41 | 42 | 43 | 44 | 45 | 46 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 47 | Plugin.VersionTracking.Abstractions 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Plugin.VersionTracking.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany ("Colby Williams")] 12 | [assembly: AssemblyProduct("Plugin.VersionTracking.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2016 Colby Williams")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("38453772-383c-4ada-845b-100c5b84f50a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.iOS/VersionTrackingImplementation.cs: -------------------------------------------------------------------------------- 1 | using Plugin.VersionTracking.Abstractions; 2 | using System; 3 | using System.Linq; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | using Foundation; 8 | 9 | namespace Plugin.VersionTracking 10 | { 11 | /// 12 | /// Implementation for VersionTracking 13 | /// 14 | public class VersionTrackingImplementation : IVersionTracking 15 | { 16 | Dictionary> versionTrail; 17 | 18 | bool isFirstLaunchEver; 19 | bool isFirstLaunchForVersion; 20 | bool isFirstLaunchForBuild; 21 | 22 | const string xamUserDefaultsVersionTrailKey = @"xamVersionTrail"; 23 | const string xamVersionsKey = @"xamVersion"; 24 | const string xamBuildsKey = @"xamBuild"; 25 | 26 | 27 | /// 28 | /// Call this as the VERY FIRST THING in FinishedLaunching 29 | /// 30 | public void Track() 31 | { 32 | var needsSync = false; 33 | 34 | // load history 35 | var nsOldVersionTrail = NSUserDefaults.StandardUserDefaults.DictionaryForKey(xamUserDefaultsVersionTrailKey); 36 | 37 | //check if its the first ever launch 38 | if (nsOldVersionTrail == null) { 39 | 40 | isFirstLaunchEver = true; 41 | 42 | versionTrail = new Dictionary> { 43 | { xamVersionsKey, new List() }, 44 | { xamBuildsKey, new List() } 45 | }; 46 | 47 | } else { 48 | 49 | versionTrail = new Dictionary>(); 50 | 51 | foreach (var item in nsOldVersionTrail) { 52 | 53 | var key = item.Key.ToString(); 54 | var val = item.Value as NSArray; 55 | 56 | if (key != null && val != null) { 57 | 58 | var list = new List(); 59 | 60 | for (int i = 0; i < (int)val.Count; i++) { 61 | list.Add(val.GetItem((nuint)i).ToString()); 62 | } 63 | 64 | versionTrail.Add(key, list); 65 | } 66 | } 67 | 68 | isFirstLaunchEver = false; 69 | 70 | needsSync = true; 71 | } 72 | 73 | //check if this version was previously launched 74 | if (versionTrail[xamVersionsKey].Contains(CurrentVersion)) { 75 | 76 | isFirstLaunchForVersion = false; 77 | 78 | } else { 79 | 80 | isFirstLaunchForVersion = true; 81 | 82 | versionTrail[xamVersionsKey].Add(CurrentVersion); 83 | 84 | needsSync = true; 85 | } 86 | 87 | //check if this build was previously launched 88 | if (versionTrail[xamBuildsKey].Contains(CurrentBuild)) { 89 | 90 | isFirstLaunchForBuild = false; 91 | 92 | } else { 93 | 94 | isFirstLaunchForBuild = true; 95 | 96 | versionTrail[xamBuildsKey].Add(CurrentBuild); 97 | 98 | needsSync = true; 99 | } 100 | 101 | //store the new version stuff 102 | if (needsSync) { 103 | 104 | var nsDict = NSDictionary.FromObjectsAndKeys( 105 | versionTrail.Values.Select(l => new NSMutableArray(l.Select(s => new NSString(s)).ToArray())).ToArray(), 106 | versionTrail.Keys.Select(s => new NSString(s)).ToArray()); 107 | 108 | NSUserDefaults.StandardUserDefaults[xamUserDefaultsVersionTrailKey] = nsDict; 109 | 110 | NSUserDefaults.StandardUserDefaults.Synchronize(); 111 | } 112 | } 113 | 114 | 115 | /// 116 | /// Check if this is the first time ever that the app is launched. 117 | /// 118 | /// The is first launch ever. 119 | public bool IsFirstLaunchEver => isFirstLaunchEver; 120 | 121 | 122 | /// 123 | /// Check if this is the first time that this particular version is being launched. 124 | /// 125 | /// The is first launch for current version. 126 | public bool IsFirstLaunchForVersion => isFirstLaunchForVersion; 127 | 128 | 129 | /// 130 | /// Check if this is the first time that this particular build is being launched. 131 | /// 132 | /// The is first launch for current build. 133 | public bool IsFirstLaunchForBuild => isFirstLaunchForBuild; 134 | 135 | 136 | /// 137 | /// Returns the current version of the app, as defined in the PList, e.g. "4.3". 138 | /// 139 | /// The current version. 140 | public string CurrentVersion => NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleShortVersionString").ToString(); 141 | 142 | 143 | /// 144 | /// Returns the current build of the app, as defined in the PList, e.g. "4300". 145 | /// 146 | /// The current build. 147 | public string CurrentBuild => NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleVersion").ToString(); 148 | 149 | 150 | /// 151 | /// Returns the previous version of the app, e.g. "4.3". 152 | /// 153 | /// The previous version. 154 | public string PreviousVersion { 155 | get { 156 | 157 | var count = versionTrail?[xamVersionsKey]?.Count ?? 0; 158 | 159 | return (count >= 2) ? versionTrail[xamVersionsKey][count - 2] : null; 160 | } 161 | } 162 | 163 | 164 | /// 165 | /// Returns the previous build of the app, "4300". 166 | /// 167 | /// The previous build. 168 | public string PreviousBuild { 169 | get { 170 | 171 | var count = versionTrail?[xamBuildsKey]?.Count ?? 0; 172 | 173 | return (count >= 2) ? versionTrail[xamBuildsKey][count - 2] : null; 174 | } 175 | } 176 | 177 | 178 | /// 179 | /// Returns the version which the user first installed the app. 180 | /// 181 | /// The first installed version. 182 | public string FirstInstalledVersion => versionTrail?[xamVersionsKey]?.FirstOrDefault(); 183 | 184 | 185 | /// 186 | /// Returns the build which the user first installed the app. 187 | /// 188 | /// The first installed build. 189 | public string FirstInstalledBuild => versionTrail?[xamBuildsKey]?.FirstOrDefault(); 190 | 191 | 192 | /// 193 | /// Returns a List of versions which the user has had installed, e.g. ["3.5", "4.0", "4.1"]. 194 | /// The List is ordered from first version installed to (including) the current version 195 | /// 196 | /// The version history. 197 | public List VersionHistory => versionTrail?[xamVersionsKey] ?? new List(); 198 | 199 | 200 | /// 201 | /// Returns a List of builds which the user has had installed, e.g. ["3500", "4000", "4100"]. 202 | /// The List is ordered from first build installed to (including) the current build 203 | /// 204 | /// The build history. 205 | public List BuildHistory => versionTrail?[xamBuildsKey] ?? new List(); 206 | 207 | 208 | /// 209 | /// Check if this is the first launch for a particular version number. 210 | /// Useful if you want to execute some code for first time launches of a particular version 211 | /// (like db migrations?). 212 | /// 213 | /// The first launch for version. 214 | /// Version. 215 | public bool FirstLaunchForVersion(string version) => 216 | (CurrentVersion.Equals(version, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForVersion; 217 | 218 | 219 | /// 220 | /// Check if this is the first launch for a particular build number. 221 | /// Useful if you want to execute some code for first time launches of a particular version 222 | /// (like db migrations?). 223 | /// 224 | /// The first launch for build. 225 | /// Build. 226 | public bool FirstLaunchForBuild(string build) => 227 | (CurrentBuild.Equals(build, StringComparison.OrdinalIgnoreCase)) && isFirstLaunchForBuild; 228 | 229 | 230 | 231 | /// 232 | /// Calls block if the condition is satisfied that the current version matches `version`, 233 | /// and this is the first time this app version is being launched. 234 | /// 235 | /// The first launch of version. 236 | /// Version. 237 | /// Block. 238 | public void OnFirstLaunchOfVersion(string version, Action block) 239 | { 240 | if (FirstLaunchForVersion(version)) block?.Invoke(); 241 | } 242 | 243 | 244 | /// 245 | /// Calls block if the condition is satisfied that the current build matches `build`, 246 | /// and this is the first time this app build is being launched. 247 | /// 248 | /// The first launch of build. 249 | /// Build. 250 | /// Block. 251 | public void OnFirstLaunchOfBuild(string build, Action block) 252 | { 253 | if (FirstLaunchForBuild(build)) block?.Invoke(); 254 | } 255 | 256 | /// 257 | /// Output to string 258 | /// 259 | /// 260 | public override string ToString() 261 | { 262 | var sb = new StringBuilder(); 263 | sb.AppendLine(); 264 | sb.AppendLine("VersionTracking"); 265 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchEver".PadRight(25), IsFirstLaunchEver); 266 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForVersion".PadRight(25), IsFirstLaunchForVersion); 267 | sb.AppendFormat(" {0}{1}\n", "IsFirstLaunchForBuild".PadRight(25), IsFirstLaunchForBuild); 268 | sb.AppendFormat(" {0}{1}\n", "CurrentVersion".PadRight(25), CurrentVersion); 269 | sb.AppendFormat(" {0}{1}\n", "PreviousVersion".PadRight(25), PreviousVersion); 270 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledVersion".PadRight(25), FirstInstalledVersion); 271 | sb.AppendFormat(" {0}[ {1} ]\n", "VersionHistory".PadRight(25), string.Join(", ", VersionHistory)); 272 | sb.AppendFormat(" {0}{1}\n", "CurrentBuild".PadRight(25), CurrentBuild); 273 | sb.AppendFormat(" {0}{1}\n", "PreviousBuild".PadRight(25), PreviousBuild); 274 | sb.AppendFormat(" {0}{1}\n", "FirstInstalledBuild".PadRight(25), FirstInstalledBuild); 275 | sb.AppendFormat(" {0}[ {1} ]\n", "BuildHistory".PadRight(25), string.Join(", ", BuildHistory)); 276 | return sb.ToString(); 277 | } 278 | } 279 | } -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.macOS/Plugin.VersionTracking.macOS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | {C5EC8220-E27E-4382-808D-991328F0547F} 7 | {A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 8 | Library 9 | Plugin.VersionTracking 10 | Plugin.VersionTracking 11 | v2.0 12 | Xamarin.Mac 13 | Resources 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug 20 | DEBUG; 21 | prompt 22 | 4 23 | false 24 | false 25 | false 26 | false 27 | false 28 | 29 | 30 | 31 | 32 | 33 | 34 | true 35 | bin\Release 36 | 37 | prompt 38 | 4 39 | false 40 | false 41 | false 42 | false 43 | false 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | CrossVersionTracking.cs 58 | 59 | 60 | VersionTrackingImplementation.cs 61 | 62 | 63 | 64 | 65 | {6EDB0588-FFC5-4EF5-8A99-9E241D0F878D} 66 | Plugin.VersionTracking.Abstractions 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking.macOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle ("Plugin.VersionTracking.macOS")] 8 | [assembly: AssemblyDescription ("")] 9 | [assembly: AssemblyConfiguration ("")] 10 | [assembly: AssemblyCompany ("Xamarin | Microsoft")] 11 | [assembly: AssemblyProduct ("")] 12 | [assembly: AssemblyCopyright ("Copyright © 2016 Colby Williams")] 13 | [assembly: AssemblyTrademark ("")] 14 | [assembly: AssemblyCulture ("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion ("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking/CrossVersionTracking.cs: -------------------------------------------------------------------------------- 1 | using Plugin.VersionTracking.Abstractions; 2 | using System; 3 | 4 | namespace Plugin.VersionTracking 5 | { 6 | /// 7 | /// Cross platform VersionTracking implemenations 8 | /// 9 | public class CrossVersionTracking 10 | { 11 | static Lazy Implementation = new Lazy(() => CreateVersionTracking(), System.Threading.LazyThreadSafetyMode.PublicationOnly); 12 | 13 | /// 14 | /// Current settings to use 15 | /// 16 | public static IVersionTracking Current 17 | { 18 | get 19 | { 20 | var ret = Implementation.Value; 21 | if (ret == null) 22 | { 23 | throw NotImplementedInReferenceAssembly(); 24 | } 25 | return ret; 26 | } 27 | } 28 | 29 | static IVersionTracking CreateVersionTracking() 30 | { 31 | #if PORTABLE 32 | return null; 33 | #else 34 | return new VersionTrackingImplementation(); 35 | #endif 36 | } 37 | 38 | internal static Exception NotImplementedInReferenceAssembly() 39 | { 40 | return new NotImplementedException("This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking/Plugin.VersionTracking.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.0 5 | false 6 | 7 | 8 | 9 | TRACE;PORTABLE 10 | 11 | 12 | 13 | TRACE;DEBUG;PORTABLE 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /VersionTracking/Plugin.VersionTracking/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Resources; 2 | using System.Reflection; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("Plugin.VersionTracking")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany ("Colby Williams")] 13 | [assembly: AssemblyProduct("Plugin.VersionTracking")] 14 | [assembly: AssemblyCopyright("Copyright © 2016 Colby Williams")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: NeutralResourcesLanguage("en")] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace VersionTrackingTests.Droid 11 | { 12 | [Activity (Label = "VersionTrackingTests", Icon = "@drawable/icon", Theme="@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 14 | { 15 | protected override void OnCreate (Bundle bundle) 16 | { 17 | TabLayoutResource = Resource.Layout.Tabbar; 18 | ToolbarResource = Resource.Layout.Toolbar; 19 | 20 | base.OnCreate (bundle); 21 | 22 | global::Xamarin.Forms.Forms.Init (this, bundle); 23 | LoadApplication (new VersionTrackingTests.App ()); 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("VersionTrackingTests.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("VersionTrackingTests.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.Android/Resources/drawable/icon.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/VersionTrackingTests.Android.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8.0.30703 8 | 2.0 9 | {CB4CCC51-26BF-4EBA-AA5D-13688C11C6D2} 10 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 11 | Library 12 | Properties 13 | VersionTrackingTests.Droid 14 | VersionTrackingTests.Android 15 | 512 16 | true 17 | Resources\Resource.Designer.cs 18 | Off 19 | Properties\AndroidManifest.xml 20 | true 21 | v8.0 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | true 31 | full 32 | false 33 | bin\Debug\ 34 | DEBUG;TRACE 35 | prompt 36 | 4 37 | True 38 | None 39 | armeabi,armeabi-v7a,x86 40 | 41 | 42 | pdbonly 43 | true 44 | bin\Release\ 45 | TRACE 46 | prompt 47 | 4 48 | False 49 | SdkOnly 50 | 51 | 52 | 53 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\FormsViewGroup.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | ..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.dll 63 | 64 | 65 | ..\..\packages\Xamarin.Android.Support.Annotations.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Annotations.dll 66 | 67 | 68 | ..\..\packages\Xamarin.Android.Support.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Compat.dll 69 | 70 | 71 | ..\..\packages\Xamarin.Android.Support.Core.UI.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.UI.dll 72 | 73 | 74 | ..\..\packages\Xamarin.Android.Support.Core.Utils.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Core.Utils.dll 75 | 76 | 77 | ..\..\packages\Xamarin.Android.Support.Design.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Design.dll 78 | 79 | 80 | ..\..\packages\Xamarin.Android.Support.Fragment.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Fragment.dll 81 | 82 | 83 | ..\..\packages\Xamarin.Android.Support.Media.Compat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Media.Compat.dll 84 | 85 | 86 | ..\..\packages\Xamarin.Android.Support.v4.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v4.dll 87 | 88 | 89 | ..\..\packages\Xamarin.Android.Support.v7.AppCompat.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.dll 90 | 91 | 92 | ..\..\packages\Xamarin.Android.Support.v7.CardView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.CardView.dll 93 | 94 | 95 | ..\..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.dll 96 | 97 | 98 | ..\..\packages\Xamarin.Android.Support.v7.RecyclerView.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.v7.RecyclerView.dll 99 | 100 | 101 | ..\..\packages\Xamarin.Android.Support.Vector.Drawable.25.4.0.2\lib\MonoAndroid70\Xamarin.Android.Support.Vector.Drawable.dll 102 | 103 | 104 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Core.dll 105 | 106 | 107 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 108 | 109 | 110 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 111 | 112 | 113 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 140 | Plugin.VersionTracking.Abstractions 141 | 142 | 143 | {56a56f17-7de1-4ca1-9617-bf32e971ac84} 144 | Plugin.VersionTracking.Android 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 190 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.Android/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace VersionTrackingTests.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | #if DEBUG 44 | if (System.Diagnostics.Debugger.IsAttached) 45 | { 46 | this.DebugSettings.EnableFrameRateCounter = true; 47 | } 48 | #endif 49 | 50 | Frame rootFrame = Window.Current.Content as Frame; 51 | 52 | // Do not repeat app initialization when the Window already has content, 53 | // just ensure that the window is active 54 | if (rootFrame == null) 55 | { 56 | // Create a Frame to act as the navigation context and navigate to the first page 57 | rootFrame = new Frame(); 58 | 59 | rootFrame.NavigationFailed += OnNavigationFailed; 60 | 61 | Xamarin.Forms.Forms.Init(e); 62 | 63 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 64 | { 65 | //TODO: Load state from previously suspended application 66 | } 67 | 68 | // Place the frame in the current Window 69 | Window.Current.Content = rootFrame; 70 | } 71 | 72 | if (rootFrame.Content == null) 73 | { 74 | // When the navigation stack isn't restored navigate to the first page, 75 | // configuring the new page by passing required information as a navigation 76 | // parameter 77 | rootFrame.Navigate(typeof(MainPage), e.Arguments); 78 | } 79 | // Ensure the current window is active 80 | Window.Current.Activate(); 81 | } 82 | 83 | /// 84 | /// Invoked when Navigation to a certain page fails 85 | /// 86 | /// The Frame which failed navigation 87 | /// Details about the navigation failure 88 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 89 | { 90 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 91 | } 92 | 93 | /// 94 | /// Invoked when application execution is being suspended. Application state is saved 95 | /// without knowing whether the application will be terminated or resumed with the contents 96 | /// of memory still intact. 97 | /// 98 | /// The source of the suspend request. 99 | /// Details about the suspend request. 100 | private void OnSuspending(object sender, SuspendingEventArgs e) 101 | { 102 | var deferral = e.SuspendingOperation.GetDeferral(); 103 | //TODO: Save application state and stop any background activity 104 | deferral.Complete(); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-100.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-125.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-150.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/LockScreenLogo.scale-400.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.UWP/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.Foundation; 7 | using Windows.Foundation.Collections; 8 | using Windows.UI.Xaml; 9 | using Windows.UI.Xaml.Controls; 10 | using Windows.UI.Xaml.Controls.Primitives; 11 | using Windows.UI.Xaml.Data; 12 | using Windows.UI.Xaml.Input; 13 | using Windows.UI.Xaml.Media; 14 | using Windows.UI.Xaml.Navigation; 15 | 16 | namespace VersionTrackingTests.UWP 17 | { 18 | public sealed partial class MainPage 19 | { 20 | public MainPage() 21 | { 22 | this.InitializeComponent(); 23 | 24 | 25 | 26 | LoadApplication(new VersionTrackingTests.App()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | VersionTrackingTests.UWP 7 | Motz 8 | Assets\StoreLogo.png 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VersionTrackingTests.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VersionTrackingTests.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/VersionTrackingTests.UWP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x86 7 | {7DBCEAAB-414A-48A3-AED8-82F3E2EC26B8} 8 | AppContainerExe 9 | Properties 10 | VersionTrackingTests.UWP 11 | VersionTrackingTests.UWP 12 | en-US 13 | UAP 14 | 10.0.10240.0 15 | 10.0.10240.0 16 | 14 17 | true 18 | 512 19 | {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 20 | VersionTrackingTests.UWP_TemporaryKey.pfx 21 | 22 | 23 | true 24 | bin\ARM\Debug\ 25 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 26 | ;2008 27 | full 28 | ARM 29 | false 30 | prompt 31 | true 32 | 33 | 34 | bin\ARM\Release\ 35 | TRACE;NETFX_CORE;WINDOWS_UWP 36 | true 37 | ;2008 38 | pdbonly 39 | ARM 40 | false 41 | prompt 42 | true 43 | true 44 | 45 | 46 | true 47 | bin\x64\Debug\ 48 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 49 | ;2008 50 | full 51 | x64 52 | false 53 | prompt 54 | true 55 | 56 | 57 | bin\x64\Release\ 58 | TRACE;NETFX_CORE;WINDOWS_UWP 59 | true 60 | ;2008 61 | pdbonly 62 | x64 63 | false 64 | prompt 65 | true 66 | true 67 | 68 | 69 | true 70 | bin\x86\Debug\ 71 | DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP 72 | ;2008 73 | full 74 | x86 75 | false 76 | prompt 77 | true 78 | 79 | 80 | bin\x86\Release\ 81 | TRACE;NETFX_CORE;WINDOWS_UWP 82 | true 83 | ;2008 84 | pdbonly 85 | x86 86 | false 87 | prompt 88 | true 89 | true 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | App.xaml 98 | 99 | 100 | MainPage.xaml 101 | 102 | 103 | 104 | 105 | 106 | Designer 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | MSBuild:Compile 143 | Designer 144 | 145 | 146 | MSBuild:Compile 147 | Designer 148 | 149 | 150 | 151 | 152 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 153 | Plugin.VersionTracking.Abstractions 154 | 155 | 156 | {e34b516d-c0d8-450f-9db0-bb6a5b04aef1} 157 | Plugin.VersionTracking.UWP 158 | 159 | 160 | 161 | 14.0 162 | 163 | 164 | 165 | 172 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/VersionTrackingTests.UWP.nuget.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | C:\GitHub\VersionTrackingPlugin\VersionTrackingTests\VersionTrackingTests.UWP\project.lock.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\James Montemagno\.nuget\packages\ 9 | ProjectJson 10 | 4.4.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/VersionTrackingTests.UWP.nuget.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.UWP/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", 4 | "Xamarin.Forms": "2.4.0.280" 5 | }, 6 | "frameworks": { 7 | "uap10.0": {} 8 | }, 9 | "runtimes": { 10 | "win10-arm": {}, 11 | "win10-arm-aot": {}, 12 | "win10-x86": {}, 13 | "win10-x86-aot": {}, 14 | "win10-x64": {}, 15 | "win10-x64-aot": {} 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace VersionTrackingTests.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init (); 26 | LoadApplication (new VersionTrackingTests.App ()); 27 | 28 | return base.FinishedLaunching (app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Info.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | VersionTrackingTests 27 | CFBundleIdentifier 28 | com.yourcompany.VersionTrackingTests 29 | CFBundleVersion 30 | 1.0 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x.png 34 | Icon-60@3x.png 35 | Icon-76.png 36 | Icon-76@2x.png 37 | Default.png 38 | Default@2x.png 39 | Default-568h@2x.png 40 | Default-Portrait.png 41 | Default-Portrait@2x.png 42 | Icon-Small-40.png 43 | Icon-Small-40@2x.png 44 | Icon-Small-40@3x.png 45 | Icon-Small.png 46 | Icon-Small@2x.png 47 | Icon-Small@3x.png 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen.storyboard 51 | 52 | 53 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace VersionTrackingTests.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VersionTrackingTests.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("VersionTrackingTests.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/VersionTrackingTests.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | iPhoneSimulator 7 | 8.0.30703 8 | 2.0 9 | {EC4D96E9-FAE7-44CE-86F7-06FBA7F51428} 10 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 11 | Exe 12 | VersionTrackingTests.iOS 13 | Resources 14 | VersionTrackingTests.iOS 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\iPhoneSimulator\Debug 23 | DEBUG 24 | prompt 25 | 4 26 | false 27 | i386, x86_64 28 | None 29 | true 30 | 31 | 32 | none 33 | true 34 | bin\iPhoneSimulator\Release 35 | prompt 36 | 4 37 | None 38 | i386, x86_64 39 | false 40 | 41 | 42 | true 43 | full 44 | false 45 | bin\iPhone\Debug 46 | DEBUG 47 | prompt 48 | 4 49 | false 50 | ARMv7, ARM64 51 | iPhone Developer 52 | true 53 | Entitlements.plist 54 | 55 | 56 | none 57 | true 58 | bin\iPhone\Release 59 | prompt 60 | 4 61 | ARMv7, ARM64 62 | false 63 | iPhone Developer 64 | Entitlements.plist 65 | 66 | 67 | none 68 | True 69 | bin\iPhone\Ad-Hoc 70 | prompt 71 | 4 72 | False 73 | ARMv7, ARM64 74 | True 75 | Automatic:AdHoc 76 | iPhone Distribution 77 | Entitlements.plist 78 | 79 | 80 | none 81 | True 82 | bin\iPhone\AppStore 83 | prompt 84 | 4 85 | False 86 | ARMv7, ARM64 87 | Automatic:AppStore 88 | iPhone Distribution 89 | Entitlements.plist 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll 125 | 126 | 127 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll 128 | 129 | 130 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll 131 | 132 | 133 | ..\..\packages\Xamarin.Forms.2.4.0.280\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll 134 | 135 | 136 | 137 | 138 | 139 | {6edb0588-ffc5-4ef5-8a99-9e241d0f878d} 140 | Plugin.VersionTracking.Abstractions 141 | 142 | 143 | {2882aeeb-d4cd-4eb9-8a6c-6653b33681f0} 144 | Plugin.VersionTracking.iOS 145 | false 146 | false 147 | 148 | 149 | 150 | 151 | 152 | 153 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 154 | 155 | 156 | 157 | 158 | 159 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/iTunesArtwork -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/VersionTrackingTests/VersionTrackingTests.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests.iOS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using Xamarin.Forms; 7 | 8 | namespace VersionTrackingTests 9 | { 10 | public partial class App : Application 11 | { 12 | public App () 13 | { 14 | InitializeComponent(); 15 | 16 | MainPage = new VersionTrackingTests.MainPage(); 17 | } 18 | 19 | protected override void OnStart () 20 | { 21 | // Handle when your app starts 22 | } 23 | 24 | protected override void OnSleep () 25 | { 26 | // Handle when your app sleeps 27 | } 28 | 29 | protected override void OnResume () 30 | { 31 | // Handle when your app resumes 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Xamarin.Forms; 7 | 8 | namespace VersionTrackingTests 9 | { 10 | public partial class MainPage : ContentPage 11 | { 12 | public MainPage() 13 | { 14 | InitializeComponent(); 15 | 16 | Plugin.VersionTracking.CrossVersionTracking.Current.Track(); 17 | 18 | LabelVersion.Text = Plugin.VersionTracking.CrossVersionTracking.Current.CurrentVersion; 19 | ListViewVersions.ItemsSource = Plugin.VersionTracking.CrossVersionTracking.Current.VersionHistory; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/VersionTrackingTests.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 96577c7f-4395-457f-a91b-bf2d5809693f 7 | 8 | 9 | VersionTrackingTests 10 | 11 | 12 | 13 | App.xaml 14 | 15 | 16 | MainPage.xaml 17 | 18 | 19 | 20 | 21 | Designer 22 | MSBuild:UpdateDesignTimeXaml 23 | 24 | 25 | Designer 26 | MSBuild:UpdateDesignTimeXaml 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /VersionTrackingTests/VersionTrackingTests/VersionTrackingTests.shproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 96577c7f-4395-457f-a91b-bf2d5809693f 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 2.1.0.{build}-beta 2 | image: Visual Studio 2017 3 | configuration: Release 4 | assembly_info: 5 | patch: true 6 | file: '**\AssemblyInfo.*' 7 | assembly_version: '{version}' 8 | assembly_file_version: '{version}' 9 | assembly_informational_version: '{version}' 10 | install: 11 | - echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t tools 12 | - echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t platform-tools 13 | - echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t build-tools-25.0.6 14 | - echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t android-25 15 | - echo y | "C:\Program Files (x86)\Android\android-sdk\tools\android.bat" update sdk -u -a -t android-15 16 | build_script: 17 | - cmd: >- 18 | powershell .\build.ps1 -Target Default -Verbosity diagnostic 19 | artifacts: 20 | - path: ./Build/nuget/*.nupkg 21 | name: NuGet 22 | -------------------------------------------------------------------------------- /build.cake: -------------------------------------------------------------------------------- 1 | var TARGET = Argument ("target", Argument ("t", "Default")); 2 | var VERSION = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999"); 3 | var CONFIG = Argument("configuration", EnvironmentVariable ("CONFIGURATION") ?? "Release"); 4 | var SLN = "./VersionTracking.sln"; 5 | 6 | Task("Libraries").Does(()=> 7 | { 8 | NuGetRestore (SLN); 9 | MSBuild (SLN, c => { 10 | c.Configuration = CONFIG; 11 | c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86; 12 | }); 13 | }); 14 | 15 | Task ("NuGet") 16 | .IsDependentOn ("Libraries") 17 | .Does (() => 18 | { 19 | if(!DirectoryExists("./Build/nuget/")) 20 | CreateDirectory("./Build/nuget"); 21 | 22 | NuGetPack ("./VersionTracking.nuspec", new NuGetPackSettings { 23 | Version = VERSION, 24 | OutputDirectory = "./Build/nuget/", 25 | BasePath = "./" 26 | }); 27 | }); 28 | 29 | //Build the component, which build samples, nugets, and libraries 30 | Task ("Default").IsDependentOn("NuGet"); 31 | 32 | Task ("Clean").Does (() => 33 | { 34 | CleanDirectory ("./component/tools/"); 35 | CleanDirectories ("./Build/"); 36 | CleanDirectories ("./**/bin"); 37 | CleanDirectories ("./**/obj"); 38 | }); 39 | 40 | RunTarget (TARGET); 41 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | ########################################################################## 2 | # This is the Cake bootstrapper script for PowerShell. 3 | # This file was downloaded from https://github.com/cake-build/resources 4 | # Feel free to change this file to fit your needs. 5 | ########################################################################## 6 | 7 | <# 8 | 9 | .SYNOPSIS 10 | This is a Powershell script to bootstrap a Cake build. 11 | 12 | .DESCRIPTION 13 | This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) 14 | and execute your Cake build script with the parameters you provide. 15 | 16 | .PARAMETER Script 17 | The build script to execute. 18 | .PARAMETER Target 19 | The build script target to run. 20 | .PARAMETER Configuration 21 | The build configuration to use. 22 | .PARAMETER Verbosity 23 | Specifies the amount of information to be displayed. 24 | .PARAMETER Experimental 25 | Tells Cake to use the latest Roslyn release. 26 | .PARAMETER WhatIf 27 | Performs a dry run of the build script. 28 | No tasks will be executed. 29 | .PARAMETER Mono 30 | Tells Cake to use the Mono scripting engine. 31 | .PARAMETER SkipToolPackageRestore 32 | Skips restoring of packages. 33 | .PARAMETER ScriptArgs 34 | Remaining arguments are added here. 35 | 36 | .LINK 37 | http://cakebuild.net 38 | 39 | #> 40 | 41 | [CmdletBinding()] 42 | Param( 43 | [string]$Script = "build.cake", 44 | [string]$Target = "Default", 45 | [ValidateSet("Release", "Debug")] 46 | [string]$Configuration = "Release", 47 | [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] 48 | [string]$Verbosity = "Verbose", 49 | [switch]$Experimental, 50 | [Alias("DryRun","Noop")] 51 | [switch]$WhatIf, 52 | [switch]$Mono, 53 | [switch]$SkipToolPackageRestore, 54 | [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] 55 | [string[]]$ScriptArgs 56 | ) 57 | 58 | [Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null 59 | function MD5HashFile([string] $filePath) 60 | { 61 | if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) 62 | { 63 | return $null 64 | } 65 | 66 | [System.IO.Stream] $file = $null; 67 | [System.Security.Cryptography.MD5] $md5 = $null; 68 | try 69 | { 70 | $md5 = [System.Security.Cryptography.MD5]::Create() 71 | $file = [System.IO.File]::OpenRead($filePath) 72 | return [System.BitConverter]::ToString($md5.ComputeHash($file)) 73 | } 74 | finally 75 | { 76 | if ($file -ne $null) 77 | { 78 | $file.Dispose() 79 | } 80 | } 81 | } 82 | 83 | Write-Host "Preparing to run build script..." 84 | 85 | if(!$PSScriptRoot){ 86 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent 87 | } 88 | 89 | $TOOLS_DIR = Join-Path $PSScriptRoot "tools" 90 | $NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" 91 | $CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" 92 | $NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" 93 | $PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" 94 | $PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" 95 | 96 | # Should we use mono? 97 | $UseMono = ""; 98 | if($Mono.IsPresent) { 99 | Write-Verbose -Message "Using the Mono based scripting engine." 100 | $UseMono = "-mono" 101 | } 102 | 103 | # Should we use the new Roslyn? 104 | $UseExperimental = ""; 105 | if($Experimental.IsPresent -and !($Mono.IsPresent)) { 106 | Write-Verbose -Message "Using experimental version of Roslyn." 107 | $UseExperimental = "-experimental" 108 | } 109 | 110 | # Is this a dry run? 111 | $UseDryRun = ""; 112 | if($WhatIf.IsPresent) { 113 | $UseDryRun = "-dryrun" 114 | } 115 | 116 | # Make sure tools folder exists 117 | if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { 118 | Write-Verbose -Message "Creating tools directory..." 119 | New-Item -Path $TOOLS_DIR -Type directory | out-null 120 | } 121 | 122 | # Make sure that packages.config exist. 123 | if (!(Test-Path $PACKAGES_CONFIG)) { 124 | Write-Verbose -Message "Downloading packages.config..." 125 | try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { 126 | Throw "Could not download packages.config." 127 | } 128 | } 129 | 130 | # Try find NuGet.exe in path if not exists 131 | if (!(Test-Path $NUGET_EXE)) { 132 | Write-Verbose -Message "Trying to find nuget.exe in PATH..." 133 | $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } 134 | $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 135 | if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { 136 | Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." 137 | $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName 138 | } 139 | } 140 | 141 | # Try download NuGet.exe if not exists 142 | if (!(Test-Path $NUGET_EXE)) { 143 | Write-Verbose -Message "Downloading NuGet.exe..." 144 | try { 145 | (New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE) 146 | } catch { 147 | Throw "Could not download NuGet.exe." 148 | } 149 | } 150 | 151 | $newVersion = $env:APPVEYOR_BUILD_VERSION.Replace("-beta","") 152 | $configFiles = Get-ChildItem . *.csproj -rec 153 | $assemblyVersionString = "" + $newVersion + "" 154 | $assemblyFileVersionString = "" + $newVersion + "" 155 | $versionString = "" + $newVersion + "" 156 | foreach ($file in $configFiles) 157 | { 158 | (Get-Content $file.PSPath) | 159 | Foreach-Object { $_ -replace "1.0.0.0", $assemblyVersionString } | 160 | Set-Content $file.PSPath 161 | } 162 | 163 | foreach ($file in $configFiles) 164 | { 165 | (Get-Content $file.PSPath) | 166 | Foreach-Object { $_ -replace "1.0.0.0", $assemblyFileVersionString } | 167 | Set-Content $file.PSPath 168 | } 169 | 170 | foreach ($file in $configFiles) 171 | { 172 | (Get-Content $file.PSPath) | 173 | Foreach-Object { $_ -replace "1.0.0.0", $versionString } | 174 | Set-Content $file.PSPath 175 | } 176 | 177 | # Save nuget.exe path to environment to be available to child processed 178 | $ENV:NUGET_EXE = $NUGET_EXE 179 | 180 | # Restore tools from NuGet? 181 | if(-Not $SkipToolPackageRestore.IsPresent) { 182 | Push-Location 183 | Set-Location $TOOLS_DIR 184 | 185 | # Check for changes in packages.config and remove installed tools if true. 186 | [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) 187 | if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or 188 | ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { 189 | Write-Verbose -Message "Missing or changed package.config hash..." 190 | Remove-Item * -Recurse -Exclude packages.config,nuget.exe 191 | } 192 | 193 | Write-Verbose -Message "Restoring tools from NuGet..." 194 | $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" 195 | 196 | if ($LASTEXITCODE -ne 0) { 197 | Throw "An error occured while restoring NuGet tools." 198 | } 199 | else 200 | { 201 | $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" 202 | } 203 | Write-Verbose -Message ($NuGetOutput | out-string) 204 | Pop-Location 205 | } 206 | 207 | # Make sure that Cake has been installed. 208 | if (!(Test-Path $CAKE_EXE)) { 209 | Throw "Could not find Cake.exe at $CAKE_EXE" 210 | } 211 | 212 | # Start Cake 213 | Write-Host "Running build script..." 214 | Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" 215 | exit $LASTEXITCODE 216 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ########################################################################## 4 | # This is the Cake bootstrapper script for Linux and OS X. 5 | # This file was downloaded from https://github.com/cake-build/resources 6 | # Feel free to change this file to fit your needs. 7 | ########################################################################## 8 | 9 | # Define directories. 10 | SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 11 | TOOLS_DIR=$SCRIPT_DIR/tools 12 | NUGET_EXE=$TOOLS_DIR/nuget.exe 13 | CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe 14 | PACKAGES_CONFIG=$TOOLS_DIR/packages.config 15 | PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum 16 | 17 | # Define md5sum or md5 depending on Linux/OSX 18 | MD5_EXE= 19 | if [[ "$(uname -s)" == "Darwin" ]]; then 20 | MD5_EXE="md5 -r" 21 | else 22 | MD5_EXE="md5sum" 23 | fi 24 | 25 | # Define default arguments. 26 | SCRIPT="build.cake" 27 | TARGET="Default" 28 | CONFIGURATION="Release" 29 | VERBOSITY="verbose" 30 | DRYRUN= 31 | SHOW_VERSION=false 32 | SCRIPT_ARGUMENTS=() 33 | 34 | # Parse arguments. 35 | for i in "$@"; do 36 | case $1 in 37 | -s|--script) SCRIPT="$2"; shift ;; 38 | -t|--target) TARGET="$2"; shift ;; 39 | -c|--configuration) CONFIGURATION="$2"; shift ;; 40 | -v|--verbosity) VERBOSITY="$2"; shift ;; 41 | -d|--dryrun) DRYRUN="-dryrun" ;; 42 | --version) SHOW_VERSION=true ;; 43 | --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; 44 | *) SCRIPT_ARGUMENTS+=("$1") ;; 45 | esac 46 | shift 47 | done 48 | 49 | # Make sure the tools folder exist. 50 | if [ ! -d "$TOOLS_DIR" ]; then 51 | mkdir "$TOOLS_DIR" 52 | fi 53 | 54 | # Make sure that packages.config exist. 55 | if [ ! -f "$TOOLS_DIR/packages.config" ]; then 56 | echo "Downloading packages.config..." 57 | curl -Lsfo "$TOOLS_DIR/packages.config" http://cakebuild.net/download/bootstrapper/packages 58 | if [ $? -ne 0 ]; then 59 | echo "An error occured while downloading packages.config." 60 | exit 1 61 | fi 62 | fi 63 | 64 | # Download NuGet if it does not exist. 65 | if [ ! -f "$NUGET_EXE" ]; then 66 | echo "Downloading NuGet..." 67 | curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe 68 | if [ $? -ne 0 ]; then 69 | echo "An error occured while downloading nuget.exe." 70 | exit 1 71 | fi 72 | fi 73 | 74 | # Restore tools from NuGet. 75 | pushd "$TOOLS_DIR" >/dev/null 76 | if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then 77 | find . -type d ! -name . | xargs rm -rf 78 | fi 79 | 80 | mono "$NUGET_EXE" install -ExcludeVersion 81 | if [ $? -ne 0 ]; then 82 | echo "Could not restore NuGet packages." 83 | exit 1 84 | fi 85 | 86 | $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5 87 | 88 | popd >/dev/null 89 | 90 | # Make sure that Cake has been installed. 91 | if [ ! -f "$CAKE_EXE" ]; then 92 | echo "Could not find Cake.exe at '$CAKE_EXE'." 93 | exit 1 94 | fi 95 | 96 | # Start Cake 97 | if $SHOW_VERSION; then 98 | exec mono "$CAKE_EXE" -version 99 | else 100 | exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" 101 | fi -------------------------------------------------------------------------------- /cake.packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /install-android-sdk.ps1: -------------------------------------------------------------------------------- 1 | $AndroidToolPath = "${env:ProgramFiles(x86)}\Android\android-sdk\tools\android" 2 | #$AndroidToolPath = "$env:localappdata\Android\android-sdk\tools\android" 3 | 4 | Function Get-AndroidSDKs() { 5 | $output = & $AndroidToolPath list sdk --all 6 | $sdks = $output |% { 7 | if ($_ -match '(?\d+)- (?.+), revision (?[\d\.]+)') { 8 | $sdk = New-Object PSObject 9 | Add-Member -InputObject $sdk -MemberType NoteProperty -Name Index -Value $Matches.index 10 | Add-Member -InputObject $sdk -MemberType NoteProperty -Name Name -Value $Matches.sdk 11 | Add-Member -InputObject $sdk -MemberType NoteProperty -Name Revision -Value $Matches.revision 12 | $sdk 13 | } 14 | } 15 | $sdks 16 | } 17 | 18 | Function Install-AndroidSDK() { 19 | [CmdletBinding()] 20 | Param( 21 | [Parameter(Mandatory=$true, Position=0)] 22 | [PSObject[]]$sdks 23 | ) 24 | 25 | $sdkIndexes = $sdks |% { $_.Index } 26 | $sdkIndexArgument = [string]::Join(',', $sdkIndexes) 27 | Echo 'y' | & $AndroidToolPath update sdk -u -a -t $sdkIndexArgument 28 | } 29 | 30 | $sdks = Get-AndroidSDKs |? { $_.name -like 'sdk platform*API 15*' -or $_.name -like 'google apis*api 15' } 31 | Install-AndroidSDK -sdks $sdks -------------------------------------------------------------------------------- /plugin_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colbylwilliams/VersionTrackingPlugin/1ded764b4e83449e4b475f689947b8976c756153/plugin_icon.png --------------------------------------------------------------------------------