pbakondy / cordova-plugin-sim Goto Github PK
View Code? Open in Web Editor NEW:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
License: MIT License
:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
License: MIT License
Good morning, @pbakondy !
As i know the "cordova-plugin-sim" can detect MCC, MNC and many other things. But i cant see how to get my APN settings. Is it possible to implement a solution to obtain APN settings (name, login and password)?
Thank you in advance.
I tried to much googled a lot some suggestion suggest that set android SDK version i have checked its fine which is as follows:-
What is the problem , its take my whole day actually to resolve but not found any solution....
1>------ Build started: Project: Meradriver, Configuration: Debug Android ------
1> Your environment has been set up for using Node.js 0.12.2 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\APACHECORDOVATOOLS\packages\vs-tac
1> ------ Name from source package.json: vs-tac
1> ------ Version from source package.json: 1.0.34
1> ------ Package already installed globally at correct version.
1> ------ Cordova tools 6.1.1 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\bld\Android\Debug
1> ------ platformConfigurationBinDir: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\bin\Android\Debug
1> ------ buildCommand: build
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: Meradriver
1> ------ projectSourceDir: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver
1> ------ npmInstallDir: C:\Users\skylabs\AppData\Roaming\npm
1> ------ buildTarget: AndroidEmulator
1> ------ language: en-US
1> ------ Platform android already exists
1> ------ Copying native files from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\native\android to platforms\android
1> ------ Done copying native files to platforms\android
1> ------ Updating plugins
1> ------ Currently installed plugins: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins:
1> ------ Preparing platform: android
1> Executing "before_prepare" hook for all plugins.
1> Executing "before_build" hook for all plugins.
1> Using this version of Cordova with older version of cordova-android is being deprecated. Consider upgrading to [email protected] or newer.
1> Searching PlatformJson files for differences between project vs. platform installed plugins
1> No differences found between project and android platform. Continuing...
1> Generating config.xml from defaults for platform "android"
1> Wrote out Android application name to "Meradriver"
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-hdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-ldpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-mdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-xhdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-hdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-ldpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-mdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-xhdpi\screen.png
1> splash screens: [{"src":"res/screens/android/screen-hdpi-landscape.png","density":"land-hdpi","platform":null},{"src":"res/screens/android/screen-ldpi-landscape.png","density":"land-ldpi","platform":null},{"src":"res/screens/android/screen-mdpi-landscape.png","density":"land-mdpi","platform":null},{"src":"res/screens/android/screen-xhdpi-landscape.png","density":"land-xhdpi","platform":null},{"src":"res/screens/android/screen-hdpi-portrait.png","density":"port-hdpi","platform":null},{"src":"res/screens/android/screen-ldpi-portrait.png","density":"port-ldpi","platform":null},{"src":"res/screens/android/screen-mdpi-portrait.png","density":"port-mdpi","platform":null},{"src":"res/screens/android/screen-xhdpi-portrait.png","density":"port-xhdpi","platform":null}]
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-hdpi-landscape.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-hdpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-ldpi-landscape.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-ldpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-mdpi-landscape.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-mdpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-xhdpi-landscape.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-land-xhdpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-hdpi-portrait.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-hdpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-ldpi-portrait.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-ldpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-mdpi-portrait.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-mdpi\screen.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\screens\android\screen-xhdpi-portrait.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-port-xhdpi\screen.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-hdpi\icon.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-ldpi\icon.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-mdpi\icon.png
1> deleted: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-xhdpi\icon.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\icons\android\icon-36-ldpi.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-ldpi\icon.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\icons\android\icon-48-mdpi.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-mdpi\icon.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\icons\android\icon-72-hdpi.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-hdpi\icon.png
1> copying image from D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\res\icons\android\icon-96-xhdpi.png to D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\res\drawable-xhdpi\icon.png
1> Wrote out Android package name to "meradriver.mobileapp"
1> Executing "after_prepare" hook for all plugins.
1> ------ Copied D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
1> ------ Building platform: android
1> Debug
1> ------ Build configuration options: --debug
1> Executing "before_compile" hook for all plugins.
1> Running command: cmd "/s /c ""D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\cordova\build.bat" --debug "--buildConfig=D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\build.json"""
1> ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1> JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
1> Reading build config file: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\build.json
1> Running: D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\gradlew cdvBuildDebug -b D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build.gradle -Dorg.gradle.daemon=true
1> :preBuild
1> :compileDebugNdk
1> :preDebugBuild
1> :checkDebugManifest
1> :CordovaLib:compileLint
1> :CordovaLib:copyDebugLint UP-TO-DATE
1> :CordovaLib:mergeDebugProguardFiles UP-TO-DATE
1> :CordovaLib:preBuild
1> :CordovaLib:preDebugBuild
1> :CordovaLib:checkDebugManifest
1> :CordovaLib:prepareDebugDependencies
1> :CordovaLib:compileDebugAidl
1> :CordovaLib:compileDebugRenderscript
1> :CordovaLib:generateDebugBuildConfig
1> :CordovaLib:generateDebugAssets UP-TO-DATE
1> :CordovaLib:mergeDebugAssets
1> :CordovaLib:generateDebugResValues UP-TO-DATE
1> :CordovaLib:generateDebugResources
1> :CordovaLib:packageDebugResources
1> :CordovaLib:processDebugManifest
1> :CordovaLib:processDebugResources
1> :CordovaLib:generateDebugSources
1> Note: Some input files use or override a deprecated API.
1> Note: Recompile with -Xlint:deprecation for details.
1> :CordovaLib:compileDebugJava
1> :CordovaLib:processDebugJavaRes UP-TO-DATE
1> :CordovaLib:packageDebugJar
1> :CordovaLib:compileDebugNdk
1> :CordovaLib:packageDebugJniLibs UP-TO-DATE
1> :CordovaLib:packageDebugLocalJar UP-TO-DATE
1> :CordovaLib:packageDebugRenderscript UP-TO-DATE
1> :CordovaLib:bundleDebug
1> :prepareAndroidCordovaLibUnspecifiedDebugLibrary
1> :preReleaseBuild
1> :CordovaLib:copyReleaseLint UP-TO-DATE
1> :CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
1> :CordovaLib:preReleaseBuild
1> :CordovaLib:checkReleaseManifest
1> :CordovaLib:prepareReleaseDependencies
1> :CordovaLib:compileReleaseAidl
1> :CordovaLib:compileReleaseRenderscript
1> :CordovaLib:generateReleaseBuildConfig
1> :CordovaLib:generateReleaseAssets UP-TO-DATE
1> :CordovaLib:mergeReleaseAssets
1> :CordovaLib:generateReleaseResValues UP-TO-DATE
1> :CordovaLib:generateReleaseResources
1> :CordovaLib:packageReleaseResources
1> :CordovaLib:processReleaseManifest
1> :CordovaLib:processReleaseResources
1> :CordovaLib:generateReleaseSources
1> Note: Some input files use or override a deprecated API.
1> Note: Recompile with -Xlint:deprecation for details.
1> :CordovaLib:compileReleaseJava
1> :CordovaLib:processReleaseJavaRes UP-TO-DATE
1> :CordovaLib:packageReleaseJar
1> :CordovaLib:compileReleaseNdk
1> :CordovaLib:packageReleaseJniLibs UP-TO-DATE
1> :CordovaLib:packageReleaseLocalJar UP-TO-DATE
1> :CordovaLib:packageReleaseRenderscript UP-TO-DATE
1> :CordovaLib:bundleRelease
1> :prepareComAndroidSupportAnimatedVectorDrawable2321Library
1> :prepareComAndroidSupportAppcompatV72321Library
1> :prepareComAndroidSupportSupportV42321Library
1> :prepareComAndroidSupportSupportVectorDrawable2321Library
1> :prepareDebugDependencies
1> :compileDebugAidl
1> :compileDebugRenderscript
1> :generateDebugBuildConfig
1> :generateDebugAssets UP-TO-DATE
1> :mergeDebugAssets
1> :generateDebugResValues UP-TO-DATE
1> :generateDebugResources
1> :mergeDebugResources
1> :processDebugManifest
1> D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\debug\values-v23\values.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
1>
1> D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\debug\values-v23\values.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
1> :processDebugResources FAILED
1>
1> BUILD FAILED
1>
1> Total time: 16.058 secs
1>
1>
1> FAILURE: Build failed with an exception.
1>
1> * What went wrong:
1> Execution failed for task ':processDebugResources'.
1> > com.android.ide.common.internal.LoggedErrorException: Failed to run command:
1> C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.3\aapt.exe package -f --no-crunch -I C:\Program Files (x86)\Android\android-sdk\platforms\android-22\android.jar -M D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml -S D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\debug -A D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\assets\debug -m -J D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\generated\source\r\debug -F D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package meradriver.mobileapp -0 apk --output-text-symbols D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\symbols\debug
1>MDAVSCLI : error Code:
1> 1
1> Output:
1> D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\debug\values-v23\values.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
1>
1> D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build\intermediates\res\debug\values-v23\values.xml:35: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
1>
1>
1>
1> * Try:
1> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1> Picked up _JAVA_OPTIONS: -Xmx512M
1>
1> D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\cordova\node_modules\q\q.js:126
1> throw e;
1> ^
1> Error code 1 for command: cmd with args: /s /c ""D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\gradlew" cdvBuildDebug -b "D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1> Command finished with error code 1: cmd /s /c ""D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\platforms\android\cordova\build.bat" --debug "--buildConfig=D:\Skylabs Project\Live Projects\Meradriver\Mobile App\MeradriverApp\Meradriver\Meradriver\build.json""
1>MDAVSCLI : error : cmd: Command failed with exit code 1
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Compile without issue
I received the following two compile errors and couldn't find any google searches to match the errors
C:\Users\RPO\dev\app\platforms\android\src\com\pbakondy\Sim.java:134: error
ContextCompat.checkSelfPermission(this.cordova.getActivity(), type));
^ (pointing to '.' between after ContextCompat)
symbol: method checkSelfPermission(Activity,String)
location: class ContextCompat
C:\Users\RPO\dev\app\platforms\android\src\com\pbakondy\Sim.java:139: error: cannot find sym
ActivityCompat.requestPermissions(this.cordova.getActivity(), new String[]{type}, 12345);
^ (pointing to '.' after ActivityCompat)
symbol: method requestPermissions(Activity,String[],int)
location: class ActivityCompat
Remove this hint: these checkboxes can be checked like this: [x]
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
Do you have a example for use cordova plugin sim?
Thanks
Is there any way to get a callback within requestReadPermission? The setTimeout() works but its not an ideal situation Something similar to how cordova-plugin-diagnostics requests permissions for various features.
I am doing this for a chained set of promises to step through app initialization to get user permissions but the native behavior of sim.requestReadPermission is relying on $timeout - or is there another method for sim?:
function getPermissions(){
var q = $q.defer();
var statuses = {};
window.plugins.sim.requestReadPermission(function(status) {
console.log('sim: '+status);
statuses['sim'] = status;
$timeout(function(){ cordova.plugins.diagnostic.requestContactsAuthorization(function(status){
console.log('accounts: '+status);
statuses['accounts'] = status;
cordova.plugins.diagnostic.requestLocationAuthorization(function(status){
console.log('gps: '+status);
statuses['gps'] = status;
q.resolve(statuses);
}) ;
});
},5000) ;
});
return q.promise;
}
Tell us what happens instead. Provide a log message if relevant
Remove this hint: these checkboxes can be checked like this: [x]
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
Tell us what should happen.
Tell us what happens instead. Provide a log message if relevant
Remove this hint: these checkboxes can be checked like this: [x]
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
Great work.. can you please share the usage code snippet? It would be greatly helpful.
It is working fine, but it is very useful to get phone number separete and country code separate. Is it possible to do that ?
I have trouble ios version 4 and I wonder if this version works or not to use another version as 10.2; Thanks for your answers
hello pbakondy,
I'm trying to use this plugin intel XDK, but does not work
this is my code:
(function()
{
"use strict";
function register_event_handlers()
{
$(document).on("click", "#cmdTel", function(evt)
{
window.plugins.sim.getSimInfo(successCallback, errorCallback);
});
}
document.addEventListener("app.Ready", register_event_handlers, false);
})();
function successCallback(result) {
$("#txttest").text(result);
}
function errorCallback(error) {
$("#txttest").text(error);
}
thanks
The build to run properly with this plugin
As soon as I install this plugin, the cordova build command doesn't build anymore
Remove this hint: these checkboxes can be checked like this: [x]
deviceready
to fire.window.onerror
catches nothing).C:\Axxiome\Development\eclipse64\Workspace64\XXX_PROJ>cordova build andr
oid
Running command: cmd "/s /c "C:\Axxiome\Development\eclipse64\Workspace64\XXX_PROJ\platforms\android\cordova\build.bat""
ANDROID_HOME=C:\Users\dce\android-sdks
JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_60
Running: C:\Axxiome\Development\eclipse64\Workspace64\XXX_PROJ\platforms
\android\gradlew cdvBuildDebug -b C:\Axxiome\Development\eclipse64\Workspace64\XXX_PROJ\platforms\android\build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all dependencies for configuration ':_debugCompile'.
Could not find any version that matches com.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-met
adata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
Required by:
:android:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
function successCallback(result) {
alert(result);//give me [object][object]
alert(result['carrierName']);//give me 'Verizon'
return result['carrierName'];//give me null
}
function errorCallback(error) {
alert(error);
}
var dataCarrier = window.plugins.carrier.getCarrierInfo(successCallback, errorCallback);
dataCarrier gives null, only alert works. How can I get carrier name to a string as dataCarrier
phoneNumber should return my phone number
It returns empty string
Remove this hint: these checkboxes can be checked like this: [x]
Android 4.4.4
deviceready
to fire.window.onerror
catches nothing).Hi,
I am unable to get imei of my windows device,Actual response as
""carrierName":"Idea","countryCode":"","mcc":"","mnc":"","isCellularDataEnabled":"False","isCellularDataRoamingEnabled":"False","IsNetworkAvailable":"True","isWiFiEnabled":"True"}".
Please help me to resolve the issue.
Thanks & Regards,
Srikanth
Tell us what should happen.
Tell us what happens instead. Provide a log message if relevant
Error in Success callbackId: Sim1675580494 : TypeError: undefined is not an object (evaluating 'navigator.connection.type')
Remove this hint: these checkboxes can be checked like this: [x]
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
I'm testing in Moto G3, Android 6.0
The phoneNumber always is empty. Why?
Hi. I use this plugin and it was working fine until i tested on an Android 6.0 device. It's always returning the error callback. Can you please help me fix this.
Thanks.
I have installed the plugin cordova-plugin-sim. When i checked this window.plugins.sim.getSimInfo(successCallback, errorCallback), it's not triggering at all. The code is not working after this line
Example: Coolpad Note 3
Example: Android 5.1
deviceready
to fire.window.onerror
catches nothing).I connect plugin and I get as I response a lot of data from phone but not the phone number. Can you tell me why?Thanks :)
Returned object is missing fields. Plugin docs state the return object should also have these keys - whether the values can be extracted or not (I think) is a different issue. but i should at least see the entire Object (as stated in the docs) correct?
"phoneNumber": "",
"deviceId": "",
"simSerialNumber": "",
"subscriberId": "",
My result object is as follows, though it is returning carrierName, seems the actual carrier can't be extracted from my phone.
Object {
callState:0
carrierName:""
countryCode:"us"
dataActivity:0
isNetworkRoaming:false
mcc:"310"
mnc:"260"
networkType:13
phoneCount:1
phoneType:1
simState:5
}
Samsung Galaxy 5S
Android 6
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Cordova 6.0
Ionic 1.7.14 (intentionally not upgrading to 2.0 yet)
cordova-plugin-sim 1.3.0
Provide the steps to reproduce the issue.
Provide files, sources if available.
This error should not be thrown, plugin should not have READ_SMS permission dependency.
getLine1NumberForDisplay: Neither user 10157 nor current process has android.permission.READ_SMS
error is thrown, no sim data returned.
Remove this hint: these checkboxes can be checked like this: [x]
Nexus 5
Android 6.0.1
deviceready
to fire.window.onerror
catches nothing).Simply run on Android 6.0.1
When I`m calling window.plugins.sim.get...., it says that windows.plugins undefined
Hi,
window.plugins.sim.getSimInfo function has no effect in Android. Also window.plugins.sim.requestReadPermission too.
Please how to resolve.
hello,
i use this code
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.plugins.sim.getSimInfo(successCallback, errorCallback);
}
function successCallback(result) {
alert(result);
}
function errorCallback(error) {
alert(error);
}
alert [ object object ]
what is the problem ?????
Can i check the information for dual sim, in case of 2 sim in the android? Can i get information of both?
Is there any another approach for android CDMA?
Is there any way to check which sim is using mobile data in case of dual sim?
Regards
Pallavi M N
The plugin should return a success callback containing SIM info, when excecuting the getSimInfo() function from a Cordova 6.3.1 app running on Windows Phone 8.1
Instead the functions returns an error callback with the string "Missing Command Error". The plugin works as expected on Android and iOS.
Nokia Lumia 630
Windows Phone 8.1
deviceready
to fire.window.onerror
catches nothing).The following deviceReady function generates the error on a fresh Cordova project:
window.plugins.sim.getSimInfo(function (sim) { console.log('foundSIM', sim); }, function (error) { console.error('SIM error', error); });
Works on Android, breaks on iOS at window.plugins.sim.getSimInfo(onSimSuccess, onSimError);
iPAD Pro (2016)
iOS 10.1.1
deviceready
to fire.window.onerror
catches nothing).install on iOS device
Provide the steps to reproduce the issue.
install on iOS device
Provide files, sources if available.
window.plugins.sim.getSimInfo(onSimSuccess, onSimError);
function onSimSuccess(__res){
console.log('SIM RES', __res);
}
function onSimError(__error){
console.log('SIM RES', __error);
}
Getting the error : undefined is not an object (evaluating 'window.plugins.sim.getSimInfo)
cards array should be listed.
cards array is null
Example: Samsung Galaxy S6, iPhone 6s
Lenovo A6000
Android 4.4.4
window.onerror
catches nothing).Cordova, ionic
The phone number not getting in all the mobiles. why? But it shows carrier name, country code etc but not phone number.
Please tell me why this plugin not getting mobile number from all kind of android mobile. How to overcome this issue..
My coding is:
"
var dataCarrier;
function successCallback(result) {
alert(result);//give me [object][object]
alert(result['carrierName']+" carrierName");//give me 'Verizon'
alert(result['countryCode']+" countryCode");//give me 'Verizon'
alert(result['mcc']+" mcc");//give me 'Verizon'
alert(result['mnc']+" mnc");//give me 'Verizon'
alert(result['callState']+" mcc");//give me 'Verizon'
alert(result['phoneNumber']+" mob num")
dataCarrier = result['phoneNumber'];
alert(dataCarrier )
}
function errorCallback(error) {
alert(error);
}
window.plugins.sim.getSimInfo(successCallback, errorCallback);
"
Its working fine in some android mobile...
Please tell me How to solve this issue..
I got Verizon and AT&T in US, and airtel in India. It can read Verizon, airtel but not AT&T. I don't have other carriers to test with like T-mobile, Sprint, etc.. So do you think AT&T block the SIM reading data via Cordova?
i have added plugin in config.xml
<gap:plugin name="cordova-plugin-sim" version="1.0.2"/>
<gap:plugin name="cordova-plugin-sim"/>
both the time phunegap build rejected
plugin unsupported: cordova-plugin-sim
Having followed the ionic tutorial, I've tried to build the release for android on Ubuntu 16.04 and get the following error:
`Error: /home/aaa/Documents/Projects/ionic/todo/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processReleaseResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-linux/build-tools/24.0.3/aapt'' finished with non-zero exit value 2
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
`
I've had a search around but can't see anything that helps with this specific error. I had a previous problem with the the android SDK and have done fresh reinstall.
Any help appreciated.
The full debug log is as follows:
`Running command: /home/aaa/Documents/Projects/ionic/todo/hooks/after_prepare/010_add_platform_class.js /home/aaa/Documents/Projects/ionic/todo
add to body class: platform-android
ANDROID_HOME=/opt/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-i386
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:compileReleaseAidl
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:processReleaseManifest
:CordovaLib:processReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processReleaseResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-linux/build-tools/24.0.3/aapt'' finished with non-zero exit value 2
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.681 secs
Error: /home/aaa/Documents/Projects/ionic/todo/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processReleaseResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/android-sdk-linux/build-tools/24.0.3/aapt'' finished with non-zero exit value 2
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
`
i found issue, Error: Cannot get sim information on IOS platform when window.plugins.sim.getSimInfo, any idea can help?
Dear Peter,
Thank you for offer this plugin, can this sim plugin offer an API to count ringing times and even record a calling?
It would be my honor that if you could send this reply to me to mail: [email protected]
Bye.
There is possible get IMEI from iPohone?
Using this plugin in Android phone , we are not able to get phone number, it just returns an empty string. Do we need to add any permission along with adding the plugin?
For Android (maybe windows), but I don't think possible on iOS, can email be extracted from sim info as well? This plugin manages to do it from Android but it has limiations and returns nothing on other devices: DeviceInformationPlugin
It might not be SIM specific but the info is pertinent and sim related, the above plugin states: E-mail/Phone number used by apps listed in your Settings > Accounts & Sync list
Tell us what happens instead. Provide a log message if relevant
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
I made this SIM info request:
function hasReadPermission() {
window.plugins.sim.hasReadPermission(function (data) {
console.log(data);
window.plugins.sim.requestReadPermission(function (data) {
console.log(data);
window.plugins.sim.getSimInfo(function (data) {
console.log(data);
}, function (error) {
console.log(error);
});
}, function (error) {
console.log(error);
});
}, function (error) {
console.log(error);
});
}
I get this SIM info object:
activeSubscriptionInfoCount:1
activeSubscriptionInfoCountMax:1
callState:0
cards:Array[1]
carrierName:"Tele2"
countryCode:"lt"
dataActivity:0
deviceId:"355609067436393"
deviceSoftwareVersion:"61"
isNetworkRoaming:false
mcc:"246"
mnc:"03"
networkType:10
phoneCount:1
phoneNumber:""
phoneType:1
simSerialNumber:"89370036211102443399"
simState:5
subscriberId:"246037021380784"
As you can see phoneNumber field is empty. I really cant undestand why? I requested permissions, so it shold work right?
Should load fine, but it is not
Tell us what happens instead. Provide a log message if relevant
Verson 1.3.0 sim is loaded into ios environment, deploying to iOS simulator iPhone 6 (iOS 10.0).
Getting error on: window.plugins.sim.requestReadPermission
- says its not a function and is undefined. It is being referenced after $ionicPlatform.ready is called. However, this all works just fine on Android.
Example: Samsung Galaxy S6, iPhone 6s
Example: Android 4.4.2, iOS 9.2
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
Here's log dump of what i get when i try to execute:
$ cordova plugin add cordova-plugin-sim
Fetching plugin "cordova-plugin-sim" via plugin registry
npm http GET http://registry.cordova.io/cordova-plugin-sim
npm http 404 http://registry.cordova.io/cordova-plugin-sim
Error: 404 Not Found: cordova-plugin-sim
at RegClient.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:268:14)
at Request.self.callback (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:876:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:827:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
Can you provide some info am i in error, or something is not set up correctly on the cordova plugin registry?
There are a lot of devices that support more than one SIM. The plugin my return an object or array with info for all the SIMs
Currently the SIM info is for one sim only.
YU YUREKA
Android 5.1.1
deviceready
to fire.window.onerror
catches nothing).Provide the used components versions (cordova, ionic, etc).
I used Ionic 2 along with Ionic native extensions.
Hey, @pbakondy
I am not able to detect roaming in iOS like android.
is there any way to detect roaming in iOS?
http://stackoverflow.com/questions/900547/is-there-any-way-to-determine-if-the-iphone-is-roaming
this link have some iOS code to detect but don't know how to use it can you please configure in plugin ?
Hey @pbakondy I am facing error while building my app, at this line, in sim.java file at line number 233,
ContextCompat.checkSelfPermission(this.cordova.getActivity(), type));
I am unable to build once i add the plugin and the code as java script in HTML file.
index.html
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.plugins.sim.getSimInfo(successCallback, errorCallback);
}
function successCallback(result) {
sap.m.MessageToast.show(result);
}
function errorCallback(error) {
sap.m.MessageToast.show(error);
}
</script>
</head>
<body>
<div id="deviceready"></div>
</body>
</html>
The error i get is :
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s
,/c,"C:\Users....\platforms\android\gradlew cdvBuildDebug -b C:\Users....\platforms\android\build.gradle -
Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users....\platforms\android\gradlew
cdvBuildDebug -b C:\Users....\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandr
oid.useDeprecatedNdk=true"
Im not getting the proper info of the device. My code is this:
// check permission
function hasReadPermission() {
window.plugins.sim.hasReadPermission(function(){
//console.log("Tiene permisos para obtener sim");
}, function(){
requestReadPermission();
});
}
// request permission
function requestReadPermission() {
// no callbacks required as this opens a popup which returns async
window.plugins.sim.requestReadPermission();
}
function getIMEI(){
hasReadPermission();
window.plugins.sim.getSimInfo(function(result){
imei = result.deviceId;
}, function(error){
console.log(error);
})
}
What i get on result is:
{
carrierName: "",
countryCode: "",
mcc: "",
mnc: "",
callState: 0,
dataActivity: 0,
isNetworkRoaming: false,
networkType: 0,
phoneType: 0,
simState: 6
}
i debugged it and i have read permissions. I know some of these information is unknown, but i dont understand why im not getting the rest of it.
Example: Tablet Xperia Z4 (No SIM card)
Example: Android 6.0.1
deviceready
to fire.window.onerror
catches nothing).Hi,
How could i get the 'phoneNumber' key output for iphone also?
When i execute this window.plugins.sim.getSimInfo(...)
function getSimInfo() {
window.plugins.sim.getSimInfo(
function (result) {
console.log(JSON.stringify(result));
},
function (error) {
console.log(error);
});
}
// The android output is
{
"carrierName": "",
"countryCode": "",
"mcc": "",
"mnc": ""
}
// the iOs output is
{
"carrierName": "",
"countryCode": "",
"mcc": "",
"mnc": "",
"allowsVOIP": false
}
Then when i Add :
requestReadPermission() for android only
before executing window.plugins.sim.getSimInfo(...). Then, i have a more rich result with the phoneNumber key inside.
But, the iphone still the same static output. Do we need a permission for IOS to get the phoneNumber?
Example: Nexus 5, Nexus 5X, iPhone 6s
Example: Android 6, Android 7.1.1 and iOS 10.1
-[x]_ It happens on a fresh Cordova CLI project as well.
deviceready
to fire.window.onerror
catches nothing).build your app
module.run(function ($ionicPlatform) {
$ionicPlatform.ready(function () {
window.plugins.sim.getSimInfo(
function (result) {
console.log(JSON.stringify(result));
},
function (error) {
console.log(error);
});
});
});
[INFO:CONSOLE(173)] "{"callState":0,"networkType":15,"phoneNumber":"","phoneType":1,"mcc":"247","countryCode":"lv","carrierName":"LV TELE2","mnc":"02","simState":5,"dataActivity":0}"
cordova-plugin-sim Plugin not getting device Id in android 6.0
it shows all the values except Device Id in Android V6.0.
I am using this code in App.js:
angular.module('starter', ['ionic','ngCordova'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
window.plugins.sim.getSimInfo(successCallback, errorCallback);
}
function successCallback(result) {
alert(JSON.stringify(result));
}
function errorCallback(error) {
alert(JSON.stringify(error));
}
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
// But its showing all the value in lower version of Android phones.
asus zenfone 2 laser
Android 6.0
Provide the used components versions (cordova, ionic, etc).
Provide the steps to reproduce the issue.
Provide files, sources if available.
I did cordova plugin add cordova-plugin-sim
and it was successfully installed without any errors.
But inside my project window.plugins.sim
does not exist.
There is only a window.plugins.insomnia
which seems to be empty.
Do i have to add some other configuration?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.