•  


[local_auth][iOS] Plugin throw NotAvailable exception in cases of No Permission, Lockout, and Face not recognized · Issue #148942 · flutter/flutter · GitHub
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

[local_auth][iOS] Plugin throw NotAvailable exception in cases of No Permission, Lockout, and Face not recognized #148942

Open
HeynSekk opened this issue May 23, 2024 · 1 comment
Assignees
Labels
p: local_auth Plugin for local authentification package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Comments

@HeynSekk
Copy link

Steps to reproduce

Code:

try
 {
      
return
 await
 auth.
authenticate
(
        localizedReason
:
 'Please authenticate to continue'
,
        options
:
 const
 AuthenticationOptions
(
          biometricOnly
:
 true
,
          useErrorDialogs
:
 false
,
        ),
      );
    } 
on
 PlatformException
 catch
 (e) {
//I get NotAvailable here

}

Expected results

it should throw with different error codes.

Actual results

It throw NotAvailable in the following cases.
No Permission case: when I disable face id permission for my app in the device setting.

Lockout case: when i do too many wrong attempt for face id,

Face not recognized case: do auth with wrong face, ios will show a dialog giving you two options 1) Enter Password, 2) Cancel. When tap Cancel, it throw NotAvailable.

Code sample

Code sample
//please run above code snippet

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):

[?] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale

    en-MM)

[?] Android toolchain - develop for Android devices (Android SDK version 34.0.0)

[?] Xcode - develop for iOS and macOS (Xcode 15.1)

[?] Chrome - develop for the web

[?] Android Studio (version 2022.3)

[?] IntelliJ IDEA Community Edition (version 2023.3.2)

[?] VS Code (version 1.89.1)

[?] Connected device (3 available)            

[?] Network resources


? No issues found!
@huycozy huycozy added the in triage Presently being triaged by the triage team label May 23, 2024
@huycozy
Copy link
Member

huycozy commented May 23, 2024

I don't have an iOS device with FaceID support but I checked this on my device with finger print: iPhone 7, iOS 15.8 . I can see NotAvailable code in the 3rd case on my end.

  • 3rd case: not recognized case (tap Cancel button when authenticating with wrong finger):
flutter: PlatformException(NotAvailable, Authentication canceled., com.apple.LocalAuthentication, null)
  • 2nd case: too many wrong attempts:
    (No error is printed)

I also checked a case by turning off passcode (Settings > Touch ID & Passcode > Turn Passcode Off) and saw the expected code outputs:

flutter: PlatformException(PasscodeNotSet, Passcode is not set., com.apple.LocalAuthentication, null)

I see there was an issue that looks similar to this at #102734 . And it seems to check if Apple's API can return separate error codes for such these case above or not. Maybe NotAvailable error code in the 3rd case is an intended code from Apple's API.

Labeling this for other's insights. This may also relate to #113687 as well.

@huycozy huycozy added platform-ios iOS applications specifically p: local_auth Plugin for local authentification package flutter/packages repository. See also p: labels. fyi-ecosystem For the attention of Ecosystem team team-ios Owned by iOS platform team and removed in triage Presently being triaged by the triage team labels May 23, 2024
@stuartmorgan stuartmorgan added the triaged-ecosystem Triaged by Ecosystem team label May 29, 2024
@flutter-triage-bot flutter-triage-bot bot removed fyi-ecosystem For the attention of Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels May 29, 2024
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment
Labels
p: local_auth Plugin for local authentification package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team
Projects
None yet
Development

No branches or pull requests

4 participants
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본