-
Notifications
You must be signed in to change notification settings - Fork 854
Description
New Issue Checklist
- Updated PhoneNumberKit to the latest version
- Phone number formatted correctly on JavaScript version
- I searched for existing GitHub issues
- I am aware that this library is not responsible of adding/removing/changing phone number formats and any request should be done at libphonenumber repo
Steps to reproduce
Customer in USA, has eSIM installed, show PhoneNumberTextfield
Expected result
Customer expects to see USA flag when PhoneNumberTextfield is created
Actual result
Customer sees French flag
Environment
Cocoapods
I think this issue is because PhoneNumberUtility's let countryCode = CNContactsUserDefaults.shared().countryCode.uppercased() is getting FR from the eSIM.
That might be correct for some use-cases, but for ours we want always the country/flag to be taken from the Settings App -> General -> Region. That would mean NOT looking at CNContactsUserDefaults ie skipping that check.
For example there could be a static property on the PhoneNumberUtility class that we could set prior to anything else, so that the Contacts framework is not used.
I'd be happy to make a PR for this, if this is a thing you'd allow to get merged.