Is there a way to get country phone prefix with react-native-localize? I can get country code, language code and may others things but I can’t seem to get the phone prefix!
For example, in Spain prefix is +34, in US I think its +1
Is there a way to get country phone prefix with react-native-localize? I can get country code, language code and may others things but I can’t seem to get the phone prefix!
For example, in Spain prefix is +34, in US I think its +1
2
Answers
You can use catamphetamine/libphonenumber-js for it. For example:
You could use an npm library such as
country-telephone-data
Here is an example of how to do it with
expo-localization
… but the principle would be very similar withreact-native-localize