jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
289 stars 184 forks source link

onCodeChanged not fired on IOS #111

Closed kttary closed 3 years ago

kttary commented 3 years ago

I'm implementing sms auto fill with the folowing code:

PinFieldAutoFill(
            decoration: UnderlineDecoration(
              textStyle: TextStyle(fontSize: 20, color: Colors.black),
              colorBuilder: FixedColorBuilder(Colors.black.withOpacity(0.3)),
            ),
            keyboardType: TextInputType.text,
            currentCode: _code,
            onCodeSubmitted: (code) {},
            onCodeChanged: (code) {
              if (code!.length == 6) {
                print("Hello $code");
                FocusScope.of(context).requestFocus(FocusNode());
              }
            },
          ),

but it seem that onCodeChanged is not fired on iOS. The 6 digit code is appear at the top of virtual keyboard and i need to tap the code at the top of virtual keyboard to fill a focussed textfield (including PinFieldAutoFill) with the OTP code. It work normally on android (PinFieldAutoFill automatically fullfilled).

jaumard commented 3 years ago

Not sure I understand, on iOS yes you need to tap on the code at the top of virtual keyboard to fill a focussed textfield. It will not be automatically

kttary commented 3 years ago

just clarify, from my code above, ios doesnt fire onCodeChange(code) so it doesnt print 'Hello 123456'