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 returns null with some sims, esp from US #11

Open
prashant2 opened this issue Dec 4, 2021 · 0 comments
Open

Country code returns null with some sims, esp from US #11

prashant2 opened this issue Dec 4, 2021 · 0 comments

Comments

@prashant2
Copy link

In internal tests, in 2 out of 4 cases, country code returned was null. Both the failed cases had US sims. What could be wrong? Is country code access denied by some service providers?

1) Tester 1:US sim, currently tester in India.
Country code returned null.
Device: iPhone 12 Pro, iOS ver: 15.0.1
Debug message in Xcode:

'2021-12-03 19:56:38.646360+0530 Runner[28490:17949780] 
[Client] Updating selectors after delegate addition failed with: 
Error Domain=NSCocoaErrorDomain Code=4099 
"The connection to service with pid 94 named com.apple.commcenter.coretelephony.xpc 
was invalidated from this process." 
 UserInfo={NSDebugDescription=The connection to service with pid 94 
 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}'

Flutter exception:
PlatformException(SIM_COUNTRY_CODE_ERROR, Error getting country, null, null)

2) Tester 2: US sim, currently in US.
Country code returned null.
Device: iPhone 12 Pro, iOS ver: 15.0.2

3) Tester 3: Indian sim, tester in India.
Correct country code returned.
Device: iPhone 8, iOS ver: 15.0

4) Tester 4: UK sim, tester in UK.
Correct country code returned.
Device: iPhone 8, iOS ver: 15.1

My flutter code:

static Future<String> getUserCountryCodeFromDevice() async {
  String sCountryCode = "";
  try {
    sCountryCode = await FlutterSimCountryCode.simCountryCode;
  } catch (e) { 
  }
  return sCountryCode;
}
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

1 participant