question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Finding out country code

See original GitHub issue

Using libphonenumber-js with ReactNative. In the phone memory, I have contacts like 51616777, etc. Is it possible to find what’s the country code, depending on the number using libphonenumber-js methods? I need to pass dynamic parameter instead of RU, depending on the number.

   let phoneNumberParsed = parsePhoneNumberFromString(contact.phoneNumbers[0].number, 'RU');

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
catamphetaminecommented, Feb 18, 2019

I meant that if you’re passing a number to the parse function then it either must start with + or you must supply a country code.

0reactions
catamphetaminecommented, Feb 18, 2019

Without + there’s no country info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Country Codes, Phone Codes, Dialing Codes, Telephone ...
COUNTRY COUNTRY CODE ISO CODES Afghanistan 93 AF / AFG Albania 355 AL / ALB Algeria 213 DZ / DZA
Read more >
International Calling Codes | Country Code Search
Country, Territory or Service Areas Country Calling Codes Time Zone DST Abkhazia +7 840, +7 940 UTC+03:00 Afghanistan +93 UTC+04:30 Åland Islands +358 18 UTC+02:00 UTC+03:00...
Read more >
International Country Calling Codes and Dialing Prefixes
Ecuador 593 00 Egypt 20 00 El Salvador 503 00 Equatorial Guinea 240 00
Read more >
International Calling Codes | Telephone Country Codes List
Dial the IDD, which for majority of the world is 00 or 011. · Add the country code from the country code list....
Read more >
Area Code Reverse Lookup Tool by Country Calling Codes
A country code reverse lookup search allows you to easily figure out from which country a call originated. For example, say someone calls...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found