summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/etc/sim.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/etc/sim.js')
-rw-r--r--StoneIsland/www/js/lib/etc/sim.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/etc/sim.js b/StoneIsland/www/js/lib/etc/sim.js
new file mode 100644
index 00000000..4507e160
--- /dev/null
+++ b/StoneIsland/www/js/lib/etc/sim.js
@@ -0,0 +1,28 @@
+var sim = (function(){
+ var sim = {}
+
+ sim.loaded = false
+ sim.data = {
+ carrierName: 'unknown',
+ countryCode: 'xx',
+ mcc: '0',
+ mnc: '0',
+ }
+
+ sim.fetch = function(){
+ window.plugins.sim.getSimInfo(sim.success, sim.error)
+ }
+
+ sim.success = function(data){
+ console.log(data)
+ sim.data = data
+ sim.data.countryCode = sim.data.countryCode.toLowerCase()
+ sim.loaded = true
+ }
+
+ sim.error = function(){
+ console.log("no SIM card detected")
+ }
+
+ return sim
+})() \ No newline at end of file