You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am retrieving contacts from my phone and parsing it using formatNumberSync function to format phone number now I am facing an issue with country codes. Let suppose some of my contacts have country code in it and some contacts don't have country code in it. How you handle this thing? As the number being parsed it plain String lie "1234567890" or "+11234567980". Now how can I handle this thing.
Thanks!
The text was updated successfully, but these errors were encountered:
It's a tricky thing. There's no real solution since you have to know the country code to correctly parse it. The best you can do is guess which is what the package tries to do.
A safe approach is to default to the device locale to get the country code, because you can reasonably assume local numbers to the device probably don't have the country code saved for most cases.
I am retrieving contacts from my phone and parsing it using
formatNumberSync
function to format phone number now I am facing an issue with country codes. Let suppose some of my contacts have country code in it and some contacts don't have country code in it. How you handle this thing? As the number being parsed it plain String lie "1234567890" or "+11234567980". Now how can I handle this thing.Thanks!
The text was updated successfully, but these errors were encountered: