macdonst / TelephoneNumberPlugin

67 stars 41 forks source link

Success but no number received #9

Closed willyguevara closed 9 years ago

willyguevara commented 9 years ago

Hello i have installed successful this plugin on my app, to get the phone number i used this code:

var telephoneNumber = cordova.require("cordova/plugin/telephonenumber"); telephoneNumber.get( function(result) { alert("result = " + result); }, function() { alert("error"); });

Runs perfectly, and returns success function, but theres no result string with the number. im using: Phonegap Version 3.5 Testing on a Huawei Device Model: HUAWEI P6-U06 with: Android version: 4.2.2

Any idea why i receive an empty string?

Thanks!

willyguevara commented 9 years ago

I think is not a problem in your code:

http://stackoverflow.com/questions/2480288/how-can-i-programmatically-obtain-the-number-of-the-android-phone-with-the-api

macdonst commented 9 years ago

Yeah, the issue you are running into is not all carriers put the phone number on the SIM card so that method I use can fail.

IgorDePaula commented 9 years ago

I'm in same situation...I tryed in sansung galaxy s III duos, with cordova 3.4, android 4.1.2, and nothing number, so empty result in success function...