pbakondy / cordova-plugin-sim

:cherries: A cordova plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
MIT License
163 stars 101 forks source link

cordova-plugin-sim close my app in the first start in onRequestReadPermission #74

Open tallensagreg opened 6 years ago

tallensagreg commented 6 years ago

Expected behaviour

cordova-plugin-sim close my app in the first start in onRequestReadPermission after is ok

Actual behaviour

i usign build phonegap and my config.xml with this config

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

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

Hardware models

Oneplus 3

OS versions

Android 6.0.1

I've checked these

  • [ ] 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).
  • [ ] I'm using the latest cordova library, Android SDK, Xcode, etc.

So how can we reproduce this?

n my firts start the app ask "autoriser XX à effectuer et gérer des appels telephonique".. but the app close automatiquely ..but the app work no probleme, just close after i restart the app ask but dont close it's ok "autoriser XX à accéder a vos contacts" and the app dont close its ok*

but for the ask phone in the first ask app close!! my .js

try on android 6.0.x ==> may be is cli-7 and builder 2 ?? thank you for help and sorry for my bad english function onDeviceReady() { window.plugins.uniqueDeviceID.get(success, errorCallback); var options = new ContactFindOptions(); options.filter="";
options.multiple=true;
var fields = ["displayName","phoneNumber"];

navigator.contacts.find(fields, onSuccess, onError, options);

requestSimPermission(); }

function readSimCard(){ window.plugins.sim.getSimInfo(successCallback, errorCallback); }

function simPermission(){ readSimCard(); }

function okread(result){ if (result==false) { console.log("okread:REquest");} else {console.log("okread:"+result);} }

function requestSimPermission(){ window.plugins.sim.requestReadPermission(readSimCard, noSimPermission); console.log("RequestSimPermission"); }

function noSimPermission(){ console.log('NoSimPermission');}

function successCallback(result) { console.log(result); }

function errorCallback(error) { console.log("erreurCallback:"+error); }