Giter VIP home page Giter VIP logo

cordova-plugin-sim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-sim's Issues

APN detection

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.

After Adding cordova.plugins.diagnostic" version="2.3.15" following Error Occurred see in comment

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 ==========

Two compile errors on Cordova build

Expected behaviour

Compile without issue

Actual behaviour

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

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device
  • iOS simulator
  • [x ] Android device
  • Android emulator

I am using

  • [ x] cordova
  • [x ] ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

Example

Do you have a example for use cordova plugin sim?

Thanks

Need call back in requestReadPermission.

Expected behaviour

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;
  }

Actual behaviour

Tell us what happens instead. Provide a log message if relevant

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

its not fetching the phone number

Expected behaviour

Tell us what should happen.

Actual behaviour

Tell us what happens instead. Provide a log message if relevant

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

Usage code snippet

Great work.. can you please share the usage code snippet? It would be greatly helpful.

phoneNumber format

It is working fine, but it is very useful to get phone number separete and country code separate. Is it possible to do that ?

intel xdk

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

cordova build android problems

Expected behaviour

The build to run properly with this plugin

Actual behaviour

As soon as I install this plugin, the cordova build command doesn't build anymore

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator
  • Android builder

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

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.

BUILD FAILED

How can I get carrier name to a string

 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 property is empty

Expected behaviour

phoneNumber should return my phone number

Actual behaviour

It returns empty string

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • Android device

I am using

  • cordova
  • ionic

OS versions

Android 4.4.4

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

Unable to get windows IMEI

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

iOS 10, xCode 8: Error in Success callbackId

Expected behaviour

Tell us what should happen.

Actual behaviour

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')

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • [x ] iOS device
  • [ x] iOS simulator
  • Android device
  • Android emulator

I am using

  • [x ] cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

Android 6.0

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.

window.plugins.sim.getSimInfo not triggering

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

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordov
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Coolpad Note 3

OS versions

Example: Android 5.1

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

Not getting Phone Number

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 Obj missing keys.

Expected behaviour

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": "",

Actual behaviour

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
}

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Samsung Galaxy 5S

OS versions

Android 6

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

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.

android.permission.READ_SMS permission error

Expected behaviour

This error should not be thrown, plugin should not have READ_SMS permission dependency.

Actual behaviour

getLine1NumberForDisplay: Neither user 10157 nor current process has android.permission.READ_SMS error is thrown, no sim data returned.

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Nexus 5

OS versions

Android 6.0.1

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Simply run on Android 6.0.1

window.plugins

When I`m calling window.plugins.sim.get...., it says that windows.plugins undefined

Compile error

Hi,

window.plugins.sim.getSimInfo function has no effect in Android. Also window.plugins.sim.requestReadPermission too.

Please how to resolve.

didnt work on iphone6+

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 ?????

Check Mobile Data enabled

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

"Missing Command Error" on WP8.1

Expected behaviour

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

Actual behaviour

Instead the functions returns an error callback with the string "Missing Command Error". The plugin works as expected on Android and iOS.

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator
  • Windows Phone 8.1 device

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Nokia Lumia 630

OS versions

Windows Phone 8.1

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

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); });

iOS device, undefined is not an object (evaluating 'window.plugins.sim.getSimInfo)

Expected behaviour

Works on Android, breaks on iOS at window.plugins.sim.getSimInfo(onSimSuccess, onSimError);

I'm seeing this behaviour on

  • [x ] iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • [ x] cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

iPAD Pro (2016)

OS versions

iOS 10.1.1

I've checked these

  • [x ] It happens on a fresh Cordova CLI project as well.
  • [ x] I'm waiting for deviceready to fire.
  • [x ] My JavaScript has no errors (window.onerror catches nothing).
  • [x ] I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

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)

Android 4.4.4 issue with dual sim

Expected behaviour

cards array should be listed.

Actual behaviour

cards array is null

I'm seeing this behaviour on

  • Android device

I am using

  • cordova
  • ionic

Hardware models

Example: Samsung Galaxy S6, iPhone 6s
Lenovo A6000

OS versions

Android 4.4.4

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Cordova, ionic

The phone number unable to get in some kind of android mobile. Why?

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..

Not reading AT&T SIM

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?

Rejected by Build.phonegap

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

Execution failed for task ':CordovaLib:processReleaseResources'. when building an android release of the ionic tutorial

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.
    `

IMEI for iOS

Expected behaviour

There is possible get IMEI from iPohone?

  • [ X] iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • [X ] cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

[FEATURE] Request for email address from sim

Expected behaviour

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

Actual behaviour

Tell us what happens instead. Provide a log message if relevant

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

PhoneNumber field is empty

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?

iOS 10 issue, requestReadPermission is undefined.

Expected behaviour

Should load fine, but it is not

Actual behaviour

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.

  • iOS device
  • [ x] iOS simulator
  • Android device
  • Android emulator

I am using

  • [x ] cordova
  • [x ] ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Samsung Galaxy S6, iPhone 6s

OS versions

Example: Android 4.4.2, iOS 9.2

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

"cordova plugin add cordova-plugin-sim" fails to execute

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?

Dual SIM info

Expected behaviour

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

Actual behaviour

Currently the SIM info is for one sim only.

  • [ #] Android device

I am using

  • [ #] cordova
  • [ #] ionic 2

Hardware models

YU YUREKA

OS versions

Android 5.1.1

I've checked these

  • [ #] It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).
I used Ionic 2 along with Ionic native extensions.

Unable to build

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"

Not getting IMEI in Android 6.0

Expected behaviour

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);
})
}

Actual behaviour

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.

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • Android device
  • Android emulator

I am using

  • cordova
  • ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Tablet Xperia Z4 (No SIM card)

OS versions

Example: Android 6.0.1

I've checked these

  • It happens on a fresh Cordova CLI project as well.
  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

Question about Android/Ios results

Hi,

Expected behaviour

How could i get the 'phoneNumber' key output for iphone also?

Actual behaviour

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?

I'm seeing this behaviour on

  • [x]_ iOS device
  • iOS simulator
  • [x]_ Android device
  • Android emulator

I am using

  • [x]_ cordova
  • [x]_ ionic
  • [x]_ PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

Example: Nexus 5, Nexus 5X, iPhone 6s

OS versions

Example: Android 6, Android 7.1.1 and iOS 10.1

I've checked these

-[x]_ It happens on a fresh Cordova CLI project as well.

  • I'm waiting for deviceready to fire.
  • My JavaScript has no errors (window.onerror catches nothing).
  • [x]_ I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

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);
	});
    });
});

Got nothing in phoneNumber field

[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

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.

I'm seeing this behaviour on

  • iOS device
  • iOS simulator
  • [x ] Android device
  • Android emulator

I am using

  • cordova
  • [x ] ionic
  • PhoneGap
  • PhoneGap Developer App
  • Intel XDK
  • Intel App Preview
  • Telerik
  • Other:

Hardware models

asus zenfone 2 laser

OS versions

Android 6.0

So how can we reproduce this?

Provide the used components versions (cordova, ionic, etc).

Provide the steps to reproduce the issue.

Provide files, sources if available.

Empty window.plugins within Phonegap Developer App

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.