keepworks / KWVerificationCodeView

A customisable verification code view to capture OTPs
MIT License
84 stars 30 forks source link

AutoFill on a UITextField is not working #41

Open thanushkaPraveen opened 4 years ago

thanushkaPraveen commented 4 years ago

Security Code Autofill in not working. Automatic OTP verification in iOS - https://developer.apple.com/videos/play/wwdc2018/204/

this library auto fill is not working because of text field are not empty. first field has " " space. so pin number from sms is not showing on the keyboard.

akshitverma commented 4 years ago

Is anyone working on this issue?

thanushkaPraveen commented 4 years ago

inside this library KWVerificationCodeView there is a class KWVerificationCodeView under extensions go to that class (KWVerificationCodeView) and change this line textFieldViews[0].numberTextField.text = " " to as this textFieldViews[0].numberTextField.text = "" (remove the space inside the quotation marks)

and then, go to KWTextFieldView class under classes folder and change this statement static let maxCharactersLength = 1 to as this static let maxCharactersLength = 0

Security Code Autofill works with these changes pin number will show on the keyboard.

sometime -> you may have to change numberTextField content type as One time code in the KWTextFieldView.xib go to -> KWTextFieldView.xib click on numberTextField change content type as One time code under input traits

MewanSnappymob commented 4 years ago

inside this library KWVerificationCodeView there is a class KWVerificationCodeView under extensions go to that class (KWVerificationCodeView) and change this line textFieldViews[0].numberTextField.text = " " to as this textFieldViews[0].numberTextField.text = "" (remove the space inside the quotation marks)

and then, go to KWTextFieldView class under classes folder and change this statement static let maxCharactersLength = 1 to as this static let maxCharactersLength = 0

Security Code Autofill works with these changes pin number will show on the keyboard.

sometime -> you may have to change numberTextField content type as One time code in the KWTextFieldView.xib go to -> KWTextFieldView.xib click on numberTextField change content type as One time code under input traits

This doesn't seem to work. Tested device - iOS 13.5.1 on iPhone 7

kpavankotesh commented 4 years ago

inside this library KWVerificationCodeView there is a class KWVerificationCodeView under extensions go to that class (KWVerificationCodeView) and change this line textFieldViews[0].numberTextField.text = " " to as this textFieldViews[0].numberTextField.text = "" (remove the space inside the quotation marks)

and then, go to KWTextFieldView class under classes folder and change this statement static let maxCharactersLength = 1 to as this static let maxCharactersLength = 0

Security Code Autofill works with these changes pin number will show on the keyboard.

sometime -> you may have to change numberTextField content type as One time code in the KWTextFieldView.xib go to -> KWTextFieldView.xib click on numberTextField change content type as One time code under input traits

@thanushkaPraveen Feel free to open a PR with these changes. We will test and if works, we will merge. Thanks.