android - Get Phone Number of real device -


i need help. need take phonenumber of device . iam using cordova-plugin-sim. heres code

this.sim.getsiminfo().then( (info) => browser.on(“loadstop”) .subscribe( () => { console.log(info.phonenumber); alert(info.phonenumber+’ '+info.cards[0].phonenumber); }, err => { console.log("inappbrowser loadstart event error: " + err); }), (err) => console.log('unable sim info: ', err) ); 

but had problem. in emulator work great, on real device had undefind when try outpu phonenumber? other parameters work great. problem? ask permissions on start of app

this.sim.hasreadpermission().then( (info) => console.log('has permission: ', info) );      this.sim.requestreadpermission().then(         () => console.log('permission granted'),         () => console.log('permission denied')     ); 


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -