facebook/facebook-java-business-sdk

Legit phone number rejected

fluidsonic opened this issue · 2 comments

Phone numbers are limited to 15 characters. However, we have a valid and verified (SMS/WhatsApp) phone number that's 16 characters long: +436789012345678. The number is anonymized but has the same number of digits and prefix.

private static String normalizePhoneNumber(String phoneNumber) {
// Replace white spaces and hyphens
phoneNumber = phoneNumber.replaceAll("[\\-\\s\\(\\)]+", "");
if(phoneNumber.length() < 6 || phoneNumber.length() > 15){
throw new IllegalArgumentException("Invalid phone number format for the passed phone number:" + phoneNumber + ". Please check the passed phone number format.");
}
return phoneNumber;
}

Thank you. We will update the if statement.

resolved.