Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-sim

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-sim - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

tests/plugin.xml

5

package.json
{
"name": "cordova-plugin-sim",
"version": "1.1.0",
"description": "A plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)",
"version": "1.2.0",
"description": "A plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, imei, etc)",
"cordova": {

@@ -27,2 +27,3 @@ "id": "cordova-plugin-sim",

"telephonenumber",
"imei",
"ecosystem:cordova",

@@ -29,0 +30,0 @@ "cordova-android",

62

README.md

@@ -70,5 +70,25 @@ # cordova-plugin-sim

<sup>1)</sup> Notice: the content of phoneNumber is unreliable (see [this](http://stackoverflow.com/questions/7922734/getting-reliable-msisdn-from-android-phone-voicemailnumber-line1number) and [this](http://stackoverflow.com/questions/25861064/retrieving-line1-number-from-telephonymanager-in-android) article).
Sometimes phoneNumber value is only an empty string.
Sometimes phoneNumber is only an empty string.
### Android Emulator results
```js
{
"carrierName": "Android",
"countryCode": "us",
"mcc": "310",
"mnc": "260",
"phoneNumber": "15555215554",
"deviceId": "0000000000000000",
"simSerialNumber": "89014103211118510720",
"subscriberId": "310260000000000",
"callState": 0,
"dataActivity": 0,
"networkType": 3,
"phoneType": 1,
"simState": 5,
"isNetworkRoaming": false
}
```
### List of Call State Codes and Meanings

@@ -137,3 +157,32 @@

### Android 6.0 Permissions
Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app.
If the device is running Android 6.0 or higher, **and** your app's target SDK is 23 or higher: The app has to list the permissions in the manifest, **and** it must request each dangerous permission it needs while the app is running. The user can grant or deny each permission, and the app can continue to run with limited capabilities even if the user denies a permission request.
Note: Beginning with Android 6.0 (API level 23), users can revoke permissions from any app at any time, even if the app targets a lower API level. You should test your app to verify that it behaves properly when it's missing a needed permission, regardless of what API level your app targets.
```js
// check permission
function hasReadPermission() {
window.plugins.sim.hasReadPermission(successCallback, errorCallback);
}
// request permission
function requestReadPermission() {
// no callbacks required as this opens a popup which returns async
window.plugins.sim.requestReadPermission();
}
```
This plugin needs `READ_PHONE_STATE` permission for getting the following values:
* `phoneNumber`
* `deviceId`
* `deviceSoftwareVersion`
* `simSerialNumber`
* `subscriberId`
## iOS Quirks

@@ -145,3 +194,14 @@

### iOS Emulator results
```js
{
"carrierName": "",
"countryCode": "",
"mcc": "",
"mnc": "",
"allowsVOIP": false
}
```
## Windows Phone Quirks

@@ -148,0 +208,0 @@

var sim = {
getSimInfo: function (successCallback, errorCallback) {
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 () {
cordova.addConstructor(function() {
if (!window.plugins) {

@@ -9,0 +15,0 @@ window.plugins = {};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc