iziz / libPhoneNumber-iOS

iOS port from libphonenumber (Google's phone number handling library)
Apache License 2.0
2.35k stars 459 forks source link

Phone number validation is not validating for Kuwait in iOS #374

Open Ashok07k opened 1 year ago

Ashok07k commented 1 year ago

I am trying to validate a Phone number of Kuwait country it is always returning false for this series but in android it working returning true, which is correct. Is there any other way to solve this.

       guard let phoneUtil = NBPhoneNumberUtil.sharedInstance() else {
               return
         }

        do {
            let phoneNumber: NBPhoneNumber = try phoneUtil.parse("41442429", defaultRegion: "KW")
            print("IsValidPhoneNumber ==> \(phoneUtil.isValidNumber(phoneNumber) ? "YES": "NO")")

        }
        catch let error as NSError {
            print(error.localizedDescription)
        }
ssbaochiweixiao commented 1 year ago

I also encountered this problem. Do you have a specific solution now? My number is true in web page verification, but it becomes false in ios project. Do you have a solution now?