Closed zrn-ns closed 9 months ago
If it is difficult to obtain a default country code, another option is to allow developers to set an arbitrary country code as default.
Hi @zrn-ns, would something like this be suitable? https://github.com/firebase/FirebaseUI-iOS/pull/1159
@morganchen12 Thank you for implementing!
It needs to be fixed in that setting a code like "JP" to defaultCountryCode
causes a crash, but the way you implemented it is exactly what I was looking for.
Fixed the crash. This API will be released today.
@morganchen12 Thank you! 🎉 🎉 🎉
Welcome to FirebaseUI and thanks for submitting an issue!
Please take a look at open issues, as well as resolved issues, to see if your issue is either already being addressed, or has been solved by someone else.
If your issue concerns the CocoaPods error, "...transitive dependencies that include static binaries", please take a look at any of the following issues and see if your problem is solved: #48, #47, #46, #34, #23.
If not, please feel free to fill in the following info so we can help faster!
Step 1: Are you in the right place?
Step 2: Describe your environment
Step 3: Describe the problem:
First of all, I would like to thank you for developing this wonderful framework.
Steps to reproduce:
Observed Results:
+1
)Expected Results:
+81
)Using Xcode 14.2, This problem does not occur and the default country code is decided by the carrier of device.
Relevant Code:
Other Info
First of all, it seems that you can get a country code (like as
+1
,+81
) by accessingCTCarrier.isoCountryCode
of CoreTelephony, but this API was deprecated in iOS16, and from 16.4, a fixed value is returned.https://developer.apple.com/forums/thread/714876
I found that the process to get the default country code (FUICountryCodes.m#127) accesses
CTCarrier.isoCountryCode
, so this is likely the cause.https://github.com/firebase/FirebaseUI-iOS/blob/4dad85472124ce78aca8d20e6a2c8658357e1d2e/FirebasePhoneAuthUI/Sources/FUICountryCodes.m#L127
The standard iOS API has been discontinued and may be difficult to fix this problem, but I would appreciate it if you could fix it.
Best regards.