Question

Im stuck to get own phone number and Sim ID (SSID) using Monotouch I tryed:

var v = NSUserDefaults.StandardUserDefaults.ValueForKey((NSString)@"SBFormattedPhoneNumber");       
var t = NSUserDefaults.StandardUserDefaults.ValueForKey((NSString)@"ICCID");

new UIAlertView("Ur phone Number",""+v.ToString(),null,"Ok",null).Show();
new UIAlertView("Ur ICCID",""+t.ToString(),null,"Ok",null).Show();

and all other ValueFor***

it always return null or " "

Tried on iphone 3g. Please help.

Was it helpful?

Solution

Apple does not want to to access this information as it can easily be misused. Any application doing so is likely to be rejected from the AppStore. See the comment (with more than 30 up votes) from this answer.

Also note that your code above does not read from the SIM - it reads from the iTunes registration data, which does not have to be set to any value (i.e. you can't trust it).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top