summaryrefslogtreecommitdiff
path: root/plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-07-03 08:31:13 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-07-03 08:31:13 -0400
commite0ba24662b631394b4076ac39fad970447879f8f (patch)
treea376c7822232389cefe6995d9b06e2ccc527f7f6 /plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs
parent1c137f2b75a18dfc3bfd8b729c58e43974c9ead2 (diff)
Added plugin that picks up version from config.xml and displays in app
Diffstat (limited to 'plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs')
-rw-r--r--plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs b/plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs
new file mode 100644
index 00000000..2f3d2c95
--- /dev/null
+++ b/plugins/uk.co.whiteoctober.cordova.appversion/src/wp8/AppVersion.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Windows;
+using System.Windows.Navigation;
+using Microsoft.Phone.Controls;
+using WPCordovaClassLib.Cordova;
+using WPCordovaClassLib.Cordova.Commands;
+using WPCordovaClassLib.Cordova.JSON;
+using Windows.ApplicationModel;
+using System.Xml.Linq;
+
+namespace Cordova.Extension.Commands
+{
+ public class AppVersion : BaseCommand
+ {
+ public void getVersionNumber(string empty)
+ {
+ //Windows.ApplicationModel.Package.current.id.version is NOT working in Windows Phone 8
+ //Workaround based on http://stackoverflow.com/questions/14371275/how-can-i-get-my-windows-store-apps-title-and-version-info
+ String version= XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
+
+ this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, version));
+ }
+ }
+}