Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Separate Android-related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pbakondy committed Feb 26, 2016
1 parent 506ea5b commit 22c1b3a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-sim",
"version": "1.2.0",
"version": "1.2.1",
"description": "A plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, imei, etc)",
"cordova": {
"id": "cordova-plugin-sim",
Expand Down
8 changes: 6 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-sim"
version="1.2.0">
version="1.2.1">
<name>SIM</name>
<description>A plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, imei, etc)</description>
<license>MIT</license>
Expand All @@ -15,7 +15,7 @@
</engines>

<js-module src="www/sim.js" name="Sim">
<clobbers target="window.plugins.sim" />
<merges target="window.plugins.sim" />
</js-module>

<!-- android -->
Expand All @@ -33,6 +33,10 @@
</config-file>

<source-file src="src/android/com/pbakondy/Sim.java" target-dir="src/com/pbakondy" />

<js-module src="www/android/sim.js" name="SimAndroid">
<merges target="window.plugins.sim" />
</js-module>
</platform>

<!-- ios -->
Expand Down
8 changes: 8 additions & 0 deletions www/android/sim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
hasReadPermission: function(successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'Sim', 'hasReadPermission', []);
},
requestReadPermission: function(successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'Sim', 'requestReadPermission', []);
}
};
17 changes: 1 addition & 16 deletions www/sim.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
var sim = {
module.exports = {
getSimInfo: function(successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'Sim', 'getSimInfo', []);
},
hasReadPermission: function(successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'Sim', 'hasReadPermission', []);
},
requestReadPermission: function(successCallback, errorCallback) {
cordova.exec(successCallback, errorCallback, 'Sim', 'requestReadPermission', []);
}
};

cordova.addConstructor(function() {
if (!window.plugins) {
window.plugins = {};
}

window.plugins.sim = sim;
return window.plugins.sim;
});

0 comments on commit 22c1b3a

Please sign in to comment.