Skip to content

feat(android): use FlutterFragmentActivity and AppCompat LaunchTheme for biometrics - #6758

Closed
mccre110 wants to merge 4 commits into
flet-dev:release/flet-1.0from
mccre110:feature/android-fragment-activity
Closed

feat(android): use FlutterFragmentActivity and AppCompat LaunchTheme for biometrics#6758
mccre110 wants to merge 4 commits into
flet-dev:release/flet-1.0from
mccre110:feature/android-fragment-activity

Conversation

@mccre110

@mccre110 mccre110 commented Aug 6, 2026

Copy link
Copy Markdown

Description

Android host infrastructure required for biometric authentication and other plugins that need a FragmentActivity (e.g. local_auth).

Changes:

  • FlutterActivityFlutterFragmentActivity in the dev client and flet build template
  • LaunchTheme parent → Theme.AppCompat.DayNight.NoActionBar (light + night) so biometric dialogs work on API 24–27
  • biometric cross-platform permission bundle (NSFaceIDUsageDescription for iOS/macOS)
  • Face ID usage string in dev client Info.plist
  • macOS publish docs: Touch ID signing notes; fixed service doc links
  • Changelog entry under ## Unreleased → Improvements

This PR is intentionally separate from the flet-local-auth extension so the host-app blast radius can be reviewed and reverted independently. The extension PR stacks on this one.

Related: closes #3192 (supersedes closed #3682) and #5226.

Note: FlutterFragmentActivity R8 keep-rule docs in website/docs/publish/android.md depend on the ProGuard/R8 docs section landing on release/flet-1.0 (on main via #6741). Functional code does not depend on that docs section.

Test code

# No Python API in this PR — verify Android template builds and biometric permission bundle:

# flet build apk / aab with:
# [tool.flet]
# permissions = ["biometric"]

# Confirm generated Android project uses FlutterFragmentActivity and AppCompat LaunchTheme.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • I have performed a self-review of my own code.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • New and existing tests pass locally with my changes.
  • I have made corresponding documentation changes, if applicable.
  • I have added changelog entries for user-facing changes, if applicable.
  • I have updated release guide pages and website/sidebars.yml for breaking changes, removals, and deprecations, if applicable.

Screenshots

N/A — host/template change; no UI change beyond correct biometric dialog behavior on Android.

Additional details

N/A

Summary by Sourcery

Update Android host apps and templates to support biometric authentication and add a cross-platform biometric permission bundle with accompanying documentation and changelog entry.

New Features:

  • Introduce a biometric cross-platform permission bundle that injects Face ID usage descriptions for iOS and macOS builds.

Enhancements:

  • Switch Android dev client and template main activities to FlutterFragmentActivity to support plugins requiring a FragmentActivity, such as biometric authentication.
  • Adopt an AppCompat LaunchTheme (Theme.AppCompat.DayNight.NoActionBar) for Android launch screens in the dev client and templates to ensure biometric dialogs work correctly on older API levels.

Documentation:

  • Document the biometric permission bundle behavior for macOS, including how to override Face ID usage descriptions.
  • Add an unreleased changelog entry describing the Android host and biometric permission changes.

cursoragent and others added 4 commits August 6, 2026 18:49
Switch the dev client and flet build template to FlutterFragmentActivity,
which local_auth requires for biometric dialogs on Android.

Re-parent LaunchTheme to Theme.AppCompat.DayNight.NoActionBar in light and
night styles so the biometric dialog does not crash on API 24-27.

Add a biometric cross-platform permission bundle for NSFaceIDUsageDescription
on iOS and macOS builds, document FlutterFragmentActivity R8 keep rules, and
note Touch ID signing requirements in macOS publish docs.

Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Remove flet-local-auth references from the host PR so docs build
passes before the extension lands.

Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@FeodorFitsner

Copy link
Copy Markdown
Contributor

The PR looks like a "base" for another one?

@mccre110

mccre110 commented Aug 6, 2026

Copy link
Copy Markdown
Author

The PR looks like a "base" for another one?

Yes for #6759. I wanted to create separate branches, but permissions were an issue. We can close this first then by #6759. The other PR includes all the changes together, so we can decide on the best merge method.

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Got it. Let's close this PR and review #6759 then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants