How can whatsapp know country code upon first run on iphone
When I first install whatsapp on iphone, when I open it, the first screen already knows my sim cards location and shows the country code. How does whatsapp know this ? As apple rejects all the apps that use sim card info programmatically. in your .h file you need to: #import <CoreTelephony/CTCarrier.h> #import <CoreTelephony/CTTelephonyNetworkInfo.h> And this function will get the country code: -(NSString*)getCountryDialingCode { NSDictionary *dialingCodes = [[NSDictionary alloc]initWithObjectsAndKeys: @"972", @"IL", @"93", @"AF", @"355", @"AL", @"213", @"DZ", @"1", @"AS", @"376", @"AD", @"244