Skip to content

Feature request: ability to ignore CNContactsUserDefaults data #881

@xaphod

Description

@xaphod

New Issue Checklist

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions