imtoori/CountryCodePicker

Storing typical phone number lengths

marchellodev opened this issue · 1 comments

Duplicate of #126 & #154

In the generic log-in use case, the phone number needs to be validated before we can actually allow the user to submit it. However, it is impossible to check if the number is correct since we do not know how many digits the country's typical phone number has.

For example, Ukrainian numbers have the prefix +380 and then 9 digits (ex. +380 95 077 3308 = total 12 digits), whereas Russian numbers have the prefix +7 and then 10 digits (ex. +7 499 077 33 08 = total 11 digits). Therefore, we cannot say whether a given number is valid without knowing how many digits the number is supposed to have.

Therefore, we should also store the phone number lengths in the dataset.