return undefined
in my phone dual sim return undefined for all
`window.plugins.sim.getSimInfo(successCallback, errorCallback);
function successCallback(result) { console.log(result); } VM51:1 Uncaught ReferenceError: errorCallback is not defined(…)(anonymous function) @ VM51:1 function onDeviceReady() { window.plugins.sim.getSimInfo(successCallback, errorCallback); }
function successCallback(result) { console.log(result); }
function errorCallback(error) { console.log(error); } undefined function hasReadPermission() { window.plugins.sim.hasReadPermission(successCallback, errorCallback); } undefined function requestReadPermission() { window.plugins.sim.requestReadPermission(successCallback, errorCallback); } undefined // Android only: request permission function requestReadPermission() { window.plugins.sim.requestReadPermission(successCallback, errorCallback); }
function successCallback(result) { console.log(result); }
function errorCallback(error) { console.log(error); }
undefined`
i add permision, now return all excepted phonenumber
I have the same exact problem
I think I've figured out why by looking Johan's answer in this stackoverflow http://stackoverflow.com/questions/2480288/programmatically-obtain-the-phone-number-of-the-android-phone
I managed to resolve, need to add the following permission to android
And also need to grant permission by the user
function requestReadPermission() { window.plugins.sim.requestReadPermission(successCallback, errorCallback); }
Is working fine for min, the problem is phone number that is not returned, as I realized it something of the android itself
@jeffersonmello I'm using dual sim card too and I'm able to get the phoneNumber after entering the SIM card number at sim card setting.
Go to your phone setting -> SIM -> select your SIM card ->edit SIM card number
@mexists Interesting I'll test this method
I am using dual sim, not able to able to get the phone number, Anybody help me how to add permissions to get phone number from real device?