summaryrefslogtreecommitdiff
path: root/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js
diff options
context:
space:
mode:
authorTeus Benschop <teusjannette@gmail.com>2018-10-28 11:51:26 +0100
committerTeus Benschop <teusjannette@gmail.com>2018-10-28 11:51:26 +0100
commit1d0ff54794b5edea7cdf1d2d66710a0fa885bcc5 (patch)
tree8ece5f9ef437fbb151f2b22ed0c6e1a714879c7c /bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js
parentc7dbdc9161a7c460526b80fe01af49d714856126 (diff)
New upstream version 1.8.1
Diffstat (limited to 'bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js')
-rw-r--r--bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js b/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js
new file mode 100644
index 0000000..16145c0
--- /dev/null
+++ b/bindings/cordova/org.crosswire.sword.cordova.SWORD/src/windows8/DeviceProxy.js
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+
+var cordova = require('cordova');
+var utils = require('cordova/utils');
+
+module.exports = {
+
+ getDeviceInfo:function(win,fail,args) {
+
+ // deviceId aka uuid, stored in Windows.Storage.ApplicationData.current.localSettings.values.deviceId
+ var deviceId;
+
+ var localSettings = Windows.Storage.ApplicationData.current.localSettings;
+
+ if (localSettings.values.deviceId) {
+ deviceId = localSettings.values.deviceId;
+ }
+ else {
+ deviceId = localSettings.values.deviceId = utils.createUUID();
+ }
+
+ setTimeout(function () {
+ win({ platform: "windows8", version: "8", uuid: deviceId, cordova: '0.0.0', model: window.clientInformation.platform });
+ }, 0);
+ }
+
+};
+
+require("cordova/windows8/commandProxy").add("Device", module.exports);
+