Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

country code on iOS 16.4.x is always '--' #7

Closed
efstathiosntonas opened this issue Apr 21, 2023 · 3 comments
Closed

country code on iOS 16.4.x is always '--' #7

efstathiosntonas opened this issue Apr 21, 2023 · 3 comments

Comments

@efstathiosntonas
Copy link

efstathiosntonas commented Apr 21, 2023

Hi, I'm using version 1.0.3 and iOS 16.4, the country code being returned is always '--' when using DeviceCountry.getCountryCode().

result:
{"code": "--", "type": "telephony"}

On previous iOS versions this was working fine.

I'm using react-native 0.71.7

@HERYORDEJY
Copy link

@efstathiosntonas I found a workaround

DeviceCountry.getCountryCode(
  Platform.OS === 'ios' ? TYPE_CONFIGURATION : TYPE_TELEPHONY,
)
  .then(result => {
      //
    }
  )

@efstathiosntonas
Copy link
Author

Thanks @HERYORDEJY-DEV, will try it out!

@mshekspirtt
Copy link
Collaborator

From IOS 16.0 CTCarrier was deprecated.
Released a new version 1.0.4, but on IOS it is now possible to get only the country code from the phone settings and passing types are not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants