Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] After getting the 'Allow' or 'Deny' pop-up, the app crashed #101

Open
4 tasks done
bhanuka96 opened this issue Sep 5, 2024 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working

Comments

@bhanuka96
Copy link

Actual Behavior

After getting the 'Allow' or 'Deny' pop-up, the app crashed. I tried this on a Xiaomi device.

Steps to Reproduce

  1. Set up OTP autofill using OTPTextEditController.
  2. Phone number detection works as expected.
  3. Receive OTP but it is not detected or autofilled into the OTP input field.

Details

  • Flutter version: Channel stable, 3.24.1
  • Platform: Android/iOS
  • macOS version: macOS 14.6.1 (23G93 darwin-arm64)
  • Android Studio: version 2024.1
  • Xcode version: 15.4
  • VS Code version: 1.92.2
  • Android SDK version: 32.1.0-rc1

Sample SMS

Your Firebase App verification code is 123456
signature_code_here

Full Code

class PhoneDetector {
  final OTPInteractor _otpInteractor = OTPInteractor();
  late OTPTextEditController controller;

  void detectPhoneNumber() {
      _otpInteractor.hint.then(phoneDetector);
  }

  void getSignature() {
      _otpInteractor.getAppSignature().then((signature) {
        debugPrint('Your app signature:$signature');
      });
  }

  void phoneDetector(String? value) {
      final _phone = value.getMobileNumberAuto(countryCode);
  }

  void listenForCode() {
      controller = OTPTextEditController(
        codeLength: 6,
        onCodeReceive: (code) {
          if (code.isEmpty) return;
          codeUpdated(code);
        },
        otpInteractor: _otpInteractor,
        onTimeOutException: () {
          controller.startListenUserConsent(
            (code) {
              final exp = RegExp(r'(\d{6})');
              return exp.stringMatch(code ?? '') ?? '';
            },
          );
        },
      )..startListenUserConsent(
          (code) {
            final exp = RegExp(r'(\d{6})');
            return exp.stringMatch(code ?? '') ?? '';
          },
        );
  }

  // @override
  void codeUpdated(String code) {
      debugPrint('SMS AUTOFILL CODE:$code');
  }

  void detectorDispose() {
      controller.stopListen();
  }
}

Checklist for Self-Check

  • Added expected and actual behavior.
  • Added an isolated way to reproduce the bug.
  • Specified Flutter, Dart version, and platform.
  • All unspecified fields in the issue description are deleted.
@bhanuka96 bhanuka96 added the bug Something isn't working label Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

Link to Pyrus task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant