Skip to content

Android ACCESS_LOCAL_NETWORK, package monorepo pubspec.yaml#1541

Open
zeyus wants to merge 59 commits into
Baseflow:mainfrom
NexusDynamic:feature/android-local-network
Open

Android ACCESS_LOCAL_NETWORK, package monorepo pubspec.yaml#1541
zeyus wants to merge 59 commits into
Baseflow:mainfrom
NexusDynamic:feature/android-local-network

Conversation

@zeyus
Copy link
Copy Markdown

@zeyus zeyus commented Jun 3, 2026

Adds the android 17 ACCESS_LOCAL_NETWORK permission.

I have also done the following:

  • Made a root / monorepo pubspec.yaml - this makes it easy to just run dart / flutter commands from the root of the repo (e.g. dart format .)
  • Made the SDK / flutter constraints consistent
  • Fixed all linting and analysis issues
  • Updates the build for github to test first (so if test fails, it wont attempt build)

BREAKING: This changes the compileSDK to 37

Note: This work was done by me, not AI.

zeyus and others added 30 commits May 27, 2026 14:41
* feat(apple): create SPM source directory structure

* feat(apple): move ObjC sources to SPM-compatible structure

* feat(apple): add public header for SPM plugin registration

* feat(apple): move PrivacyInfo.xcprivacy to SPM sources

* feat(apple): add Package.swift for Swift Package Manager support

* feat(apple): update podspec to reference SPM source structure

* chore(apple): ignore SPM build artifacts

* docs: add SPM setup instructions to README

* fix(apple): move Package.swift to correct SPM location (ios/permission_handler_apple/)

* fix(apple): add missing PERMISSION_PHOTOS_ADD_ONLY and PERMISSION_LOCATION_ALWAYS defines

* fix(apple): use forward declaration in public header to avoid missing internal import

* fix(example): bump compileSdk to 36, AGP to 8.9.1, Gradle to 8.11.1

* fix(apple): add explicit UIKit import to strategies that use UIApplication under SPM

* feat(apple): auto-detect permissions from Info.plist in Package.swift

Package.swift now walks up the directory tree from its own location to find
the app's Info.plist and enables each permission define when the corresponding
usage description key is present. This mirrors the CocoaPods workflow: adding
NSCameraUsageDescription to Info.plist is all that is needed to activate
PERMISSION_CAMERA, with no extra configuration files or terminal commands.

Environment variables remain supported as an explicit override (priority over
Info.plist), which covers PermissionGroup.notification and criticalAlerts that
have no required Info.plist key.

Users must clear DerivedData once after changing Info.plist so Xcode
re-evaluates the manifest: rm -rf ~/Library/Developer/Xcode/DerivedData

* docs: update SPM setup instructions to use Info.plist auto-detection

Replace the launchctl setenv / pre-action script approach with the new
Info.plist-based mechanism: permissions are now enabled automatically when
the corresponding usage description key is present in Info.plist, which is
already required for any permission to work at runtime.

Document the two permissions without an Info.plist key (notification,
criticalAlerts) as the only case still requiring an env var.

* chore(example): update iOS example app and remove plan artifact

- Add all permission usage description keys to Info.plist so the SPM
  Info.plist auto-detection covers all permissions out of the box
- Comment out the Siri entitlement (requires a paid Apple Developer
  account; uncomment to test PERMISSION_ASSISTANT)
- Update AppDelegate to modern FlutterImplicitEngineDelegate pattern
- Bump Podfile iOS platform to 13.0
- Remove docs/superpowers/plans/2026-05-05-spm-support.md (internal
  planning artifact not intended for the public repo)

* chore(apple): bump version to 9.4.8 and update CHANGELOG

* fix(apple): correct SPM permission flag mapping for photos and calendarWriteOnly

- PERMISSION_PHOTOS now triggers on NSPhotoLibraryAddUsageDescription alone,
  since PhotoPermissionStrategy (which handles photosAddOnly) compiles under
  PERMISSION_PHOTOS — without this, photosAddOnly silently fell back to
  UnknownPermissionStrategy when NSPhotoLibraryUsageDescription was absent
- PERMISSION_EVENTS_FULL_ACCESS now also triggers on
  NSCalendarsWriteOnlyAccessUsageDescription (iOS 17+), enabling calendarWriteOnly
  which requires PERMISSION_EVENTS || PERMISSION_EVENTS_FULL_ACCESS in native code
- Sync podspec version to 9.4.8
- Restore NSCameraUsageDescription in example Info.plist (lost during rewrite)
- Add NSCalendarsWriteOnlyAccessUsageDescription to example Info.plist

* docs: add calendarWriteOnly to SPM permission table in README

* fix(example): remove NSSiriUsageDescription and document permission constraints

Siri requires the com.apple.developer.siri entitlement; including
NSSiriUsageDescription without it crashes the app on launch under SPM.
Added a README section listing permissions that cannot be tested on
simulator or without special entitlements.

* fix(apple): enable notifications and criticalAlerts by default under SPM

These permissions have no required Info.plist key so the previous logic
always compiled them out (defaultValue "0"), causing permanentlyDenied
to be returned without ever showing a system dialog.

They are now enabled by default and can be opted out via env var set to "0".

* fix(apple): revert criticalAlerts to opt-in under SPM

criticalAlerts requires a special Apple entitlement; compiling it into
every app by default would add dead code for apps that don't use it.
Only PERMISSION_NOTIFICATIONS defaults to enabled (no entitlement needed).

* docs: clarify SPM special cases for notification and criticalAlerts

- Add both permissions to the Info.plist table with notes
- Distinguish export (terminal) vs launchctl setenv (Xcode GUI)
- Explain why criticalAlerts is opt-in (Apple entitlement required)

* chore(example): enable SPM in Xcode project for iOS example app

Flutter auto-generated FlutterGeneratedPluginSwiftPackage reference
when running with --enable-swift-package-manager.

* fix(example): align Java source/target compatibility to VERSION_17

AGP 8.x + Kotlin 1.9+ enforce JVM-target consistency; compileJava was
still on 1.8 while compileKotlin used 17, causing the build to fail.
assanbayg and others added 29 commits June 3, 2026 14:40
Fix incorrect Android SDK parameter name in documentation.

"completeSdkVersion" is not a valid Android parameter. The correct name is "compileSdkVersion". This prevents developer confusion when following the troubleshooting guide.
…low#1488)

After version 8.0.0, permission handler no longer uses all permissions on iOS, but this was not explained clearly in the README.
This is my attempt to fix that small mistake.
>
> Co-authored-by: Novarest
@zeyus zeyus changed the title Feature/android local network Android ACCESS_LOCAL_NETWORK, package monorepo pubspec.yaml Jun 4, 2026
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.

5 participants