This post:
www.b4x.com
Point on how to validate an international number based on iPhoneNumber
(open source at: https://github.com/iziz/libPhoneNumber-iOS)
Can someone give me some advice on how to return the number formated (not validation), base on the GitHub code exposed, I´m looking for "INTERNATIONAL" method. I really have little o no experience at all in using external libs.
Thanks
iPhoneNumber - validate phone numbers
This is just a compilation of this open source project: https://github.com/iziz/libPhoneNumber-iOS Usage: Add to main module #AdditionalLib: iPhoneNumber Validate: Log(IsNumberValid("(800) 555‑0199", "US")) Private Sub IsNumberValid(Number As String, DefaultRegion As String) As Boolean...

Point on how to validate an international number based on iPhoneNumber
(open source at: https://github.com/iziz/libPhoneNumber-iOS)
Can someone give me some advice on how to return the number formated (not validation), base on the GitHub code exposed, I´m looking for "INTERNATIONAL" method. I really have little o no experience at all in using external libs.
Thanks
B4X:
NBPhoneNumberUtil *phoneUtil = [NBPhoneNumberUtil sharedInstance];
NSError *anError = nil;
NBPhoneNumber *myNumber = [phoneUtil parse:@"6766077303"
defaultRegion:@"AT" error:&anError];
if (anError == nil) {
NSLog(@"isValidPhoneNumber ? [%@]", [phoneUtil isValidNumber:myNumber] ? @"YES":@"NO");
// E164 : +436766077303
NSLog(@"E164 : %@", [phoneUtil format:myNumber
numberFormat:NBEPhoneNumberFormatE164
error:&anError]);
// INTERNATIONAL : +43 676 6077303
NSLog(@"INTERNATIONAL : %@", [phoneUtil format:myNumber
numberFormat:NBEPhoneNumberFormatINTERNATIONAL
error:&anError]);
// NATIONAL : 0676 6077303
NSLog(@"NATIONAL : %@", [phoneUtil format:myNumber
numberFormat:NBEPhoneNumberFormatNATIONAL
error:&anError]);
// RFC3966 : tel:+43-676-6077303
NSLog(@"RFC3966 : %@", [phoneUtil format:myNumber
numberFormat:NBEPhoneNumberFormatRFC3966
error:&anError]);
} else {
NSLog(@"Error : %@", [anError localizedDescription]);
}
NSLog (@"extractCountryCode [%@]", [phoneUtil extractCountryCode:@"823213123123" nationalNumber:nil]);
NSString *nationalNumber = nil;
NSNumber *countryCode = [phoneUtil extractCountryCode:@"823213123123" nationalNumber:&nationalNumber];
NSLog (@"extractCountryCode [%@] [%@]", countryCode, nationalNumber);