Closed eduard-cihunka closed 2 months ago
Hey @eduard-cihunka
It's expected that you provided more information to PNK be able to parse and format phone numbers properly.
There are two ways to achieve this:
+420777666555
phoneNumberKit.parse("777666555", withRegion: "CZ")
Your issue though seems to be simple to fix, probably the property fullPhoneNumber
of your model is a calculated property, so you can simply add a +
at the beginning of the string and PNK will be able to do its job.
I hope it helps you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
New Issue Checklist
Steps to reproduce
I'm trying to parse phone number from string
420777666555
with parse functionphoneNumberKit.parse(phoneNumber.fullPhoneNumber)
where phoneNumberKit isprivate let phoneNumberKit = PhoneNumberKit()
. On Version3.5.10
everything works fine, after update to newest version I'm not able to parse czech republic numbers from string. We need to update to newest version because of apple privacy manifest. From my observations functionfunc hasValue(_ value: String?) -> Bool
returns different values after update, so maybe the issue could be there.Test examples
For better understanding, format is our internal implementation, just maps our internal format to the library one, but fail occurs on the first line where
PhoneNumberKit
trying to parse number from string.Expected result
Parsed PhoneNumber struct
Actual result
Parsing fail and result is nil
Environment
SPM