Skip to content

[local_auth] Support for macOS platform #140685

Closed
flutter/packages
#7274

Description

@OutdatedGuy

Use case

The local_auth plugin currently supports only android, ios and windows platform. It would be great to have support for macOS as well.

Proposal

We can copy the implementation of local_auth_ios and make necessary and proprietary changes to support macOS platform.

Activity

  1. added
    platform-macosBuilding on or for macOS specifically
    p: local_authPlugin for local authentification
    packageflutter/packages repository. See also p: labels.
    P3Issues that are less important to the Flutter project
    on Dec 28, 2023
  2. stuartmorgan-g commented on Dec 28, 2023

    @stuartmorgan-g
    Contributor

    We can copy the implementation of local_auth_ios

    We don't copy implementations, since that would require maintaining two copies forever; instead we share them. See path_provider, shared_preferences, and video_player for some examples.

    The first step in adding macOS support would be renaming the existing iOS package. Normally we use the name of the shared implementing framework; unfortunately in this case that's the LocalAuthentication framework, which would make the name local_auth_localauthentication. Given that I think we'll want to fall back to the less accurate, but more useful in distinguishing the implementation packages, local_auth_darwin.

    (For anyone interested in doing this, renaming needs to be done in its own PR, without any macOS additions, and then adding macOS would be a follow-up PR once the rename has landed.)

  3. stuartmorgan-g commented on Dec 28, 2023

    @stuartmorgan-g
    Contributor

    Normally we use the name of the shared implementing framework; unfortunately in this case that's the LocalAuthentication framework, which would make the name local_auth_localauthentication. Given that I think we'll want to fall back to the less accurate, but more useful in distinguishing the implementation packages, local_auth_darwin.

    /cc @jmagman in case you have any alternate thoughts for our latest installment of "Name That Shared iOS/macOS Code!" 🙂.

  4. OutdatedGuy commented on Dec 28, 2023

    @OutdatedGuy
    ContributorAuthor

    We can copy the implementation of local_auth_ios

    We don't copy implementations, since that would require maintaining two copies forever; instead we share them. See path_provider, shared_preferences, and video_player for some examples.

    The first step in adding macOS support would be renaming the existing package iOS. Normally we use the name of the shared implementing framework; unfortunately in this case that's the LocalAuthentication framework, which would make the name local_auth_localauthentication. Given that I think we'll want to fall back to the less accurate, but more useful in distinguishing the implementation packages, local_auth_darwin.

    (For anyone interested in doing this, renaming needs to be done in its own PR, without any macOS additions, and then adding macOS would be a follow-up PR once the rename has landed.)

    Hi, I don't quite understand what you mean. Can you elaborate more on this statement with a simple explanation.

  5. stuartmorgan-g commented on Dec 28, 2023

    @stuartmorgan-g
    Contributor

    I'm not sure what elaboration you are looking for. Which part isn't clear?

  6. OutdatedGuy commented on Dec 29, 2023

    @OutdatedGuy
    ContributorAuthor

    The first step in adding macOS support would be renaming the existing iOS package. Normally we use the name of the shared implementing framework; unfortunately in this case that's the LocalAuthentication framework, which would make the name local_auth_localauthentication. Given that I think we'll want to fall back to the less accurate, but more useful in distinguishing the implementation packages, local_auth_darwin.

    I didn't understand what you are telling me to do

  7. stuartmorgan-g commented on Dec 29, 2023

    @stuartmorgan-g
    Contributor

    I'm not telling you to do anything; what you choose to contribute is entirely up to you. I'm describing what we would accept for adding an endorsed macOS implementation of local_auth, which is a single package containing the shared iOS and macOS implementation.

    The process for getting from the current state to that state is at least three separate PRs:

    1. Rename local_auth_ios to something more generic, as described above.
    2. Add macOS support to that renamed package.
    3. Switch local_auth to using the new package instead of local_auth_ios.

    The relative order of 2 and 3 isn't particularly important, but 1 must be done first.

  8. depombo commented on Jan 17, 2024

    @depombo
  9. alexrabin-sentracam commented on Mar 11, 2024

    @alexrabin-sentracam

    Just wanted to give y'all a quick update, I am awaiting approval on my pr and hopefully it gets merged soon!

  10. Rimantovas commented on Jun 2, 2024

    @Rimantovas
  11. added
    team-macosOwned by the macOS platform team
    and removed on Jun 5, 2024
  12. flutter-triage-bot commented on Jun 5, 2024

    @flutter-triage-bot

    The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

  13. added a commit that references this issue on Aug 6, 2024
  14. github-actions commented on Aug 20, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopp: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-macosBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions