Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo - Disable Autofill Strong Password (autofill) on iOS 12

On my application working on Expo, I would like to disable this functionality (strong password ios 12) : https://developer.apple.com/videos/play/wwdc2018/204/

To be short, I would like to avoid this (it's not my application)

I try different way like add those properties to my textInput textContentType='none' autoCorrect={false}

Nothing works...

Any guesses ?

like image 793
Maxime Avatar asked Nov 01 '18 08:11

Maxime


2 Answers

set isSecureTextEntry to false

then in your app delegate file add:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    if (textField == self.passwordTextField && !self.passwordTextField.secureTextEntry) {
        self.passwordTextField.secureTextEntry = YES;
    }

    return YES;
}

You may need to eject your app in order to open code in xcode.

like image 96
Ankush Rishi Avatar answered Sep 30 '22 12:09

Ankush Rishi


Found the only solution for this problem.

textField.textContentType = .oneTimeCode

Otherwise iOS 12 uses PasswordAutofill for any secure field (textField.isSecureTextEntry = true).

like image 30
oskarko Avatar answered Sep 30 '22 12:09

oskarko