Get Phone Number of real device


#1

Hey guys. I need some help/ I need take phoneNumber of device . Iam using cordova-plugin-sim. Heres my 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 to get sim info: ', err)
);
But i had a problem/ In my emulator everything work great? but on my real device i had undefind when i try outpu phoneNumber? other parameters work great. Where is problem&? I ask all permissions on the 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')
    );

#2

Hi RobinBo.
I aslo have the problem like this.
have you resolved it yet?
can you show me?
thanks


#3

Am also want to get the mobile number but cant able to get it… Have you found any solutions for this.