CodeAutoFill mixin issue while listening for code
See original GitHub issueThere is a issue in the CodeAutoFill
mixin. The docs says:
listenForCode()
to listen for the SMS code from the native plugin when SMS is received, need to be called on yourinitState
.
but after some tests it seems that this is not enough. If you just do this code will not get detected. In order to start listening for the OTP you need to call both in the initState
:
@override
void initState() {
super.initState();
listenForCode();
SmsAutoFill().listenForCode;
}
If you do not call SmsAutoFill().listenForCode;
after listenForCode()
you will never receive the OTP code in the Flutter app.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Flutter Plugin to Provide OTP Code Autofill Support - Morioh
Flutter plugin to provide SMS code autoDetect support. Package which will help you to generate pin code fields. Can be useful for OTP...
Read more >Enhance SMS-delivered code security with domain-bound ...
Many websites and apps offer additional login security in the form of SMS-delivered codes. On iPhone, Security Code AutoFill makes it easy ...
Read more >Flutter Mixins and Base Classes: A recipe for success
What if Mike is a coder and we want a code function that can be used in other class, but is notused by...
Read more >Inheritance with Mixin in Flutter | by Anmol Gupta - FlutterDevs
Mixins are really great in dart as they provide us flexibility for code reusability. mixins are normal classes whose method can be used...
Read more >Blog - Archive - 2019 - Michael Tsai
... 2019 (1)December 19, 2019; How Clean Re-installs Change in Catalina December 19, 2019 ... 2019; Mixing License Codes and the Mac App...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@pedromassango I’m also trying to use the mixin and haven’t gotten it to catch the code yet. I use
with CodeAutoFill
, calllistenForCode()
andSmsAutoFill().listenForCode
ininitState
like above, I implementcodeUpdated()
.codeUpdated()
called twice in a row about one minute after receiving the text, butcode
was null. Did you have any other difficulties that might account for this? Really hard to debug this 😕Sure @pedromassango !