Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
53ea679
feat(apple): Add Swift Package Manager support and bump minimum iOS v…
daniJimen May 5, 2026
a5ac015
Removes dev.flutter.flutter-plugin-loader from example settings.gradle
daniJimen May 5, 2026
6197c73
refactor(example): migrate to new Flutter plugin loader and remove Co…
daniJimen May 5, 2026
84d1600
refactor(apple): migrate iOS example to Swift Package Manager and bum…
daniJimen May 6, 2026
3e7501e
chore: add comment for future permission_handler_apple publishing to …
daniJimen May 6, 2026
41fdc6a
chore: bump permission_handler_apple to 9.4.8 and add example Podfiles
daniJimen May 6, 2026
ab67c76
docs: update CHANGELOG.md to clarify SPM support
daniJimen May 6, 2026
ff816ce
docs: remove SPM migration entry from CHANGELOG.md
daniJimen May 6, 2026
265d387
chore: update permission_handler_apple dependency to 9.4.7
daniJimen May 6, 2026
4b7467f
chore: update Android build configuration to support API 36 and moder…
daniJimen May 6, 2026
81922e7
refactor(apple): migrate iOS example to Swift Package Manager and rem…
daniJimen May 6, 2026
86e09ae
Revert "refactor(apple): migrate iOS example to Swift Package Manager…
daniJimen May 6, 2026
3f844a0
chore(example): enable modular headers in iOS Podfile
daniJimen May 6, 2026
a8905f3
fix(example): explicitly configure CocoaPods for iOS example app
daniJimen May 6, 2026
d817468
refactor(example): modernize iOS Podfile and configure permission macros
daniJimen May 6, 2026
1003743
chore: cleanup whitespace in permission_handler_android pubspec.yaml
daniJimen May 6, 2026
9f4e271
Merge branch 'main' into feature/remove_cocoapod
daniJimen Jun 1, 2026
bea92ab
build: align Kotlin JVM target and cleanup iOS example Podfile
daniJimen Jun 1, 2026
9524ee2
chore: cleanup whitespace in permission_handler_apple iOS example Pod…
daniJimen Jun 1, 2026
97bc936
chore(android): upgrade Java and Kotlin JVM target to 18
daniJimen Jun 1, 2026
a98f871
chore(android): correct Java compatibility and JVM target to 1.8
daniJimen Jun 1, 2026
8bcc1c3
ci: upgrade Java version to 18 in GitHub workflows
daniJimen Jun 1, 2026
55466a3
chore(android): update Java compatibility and CI toolchain
daniJimen Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions permission_handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,49 @@ While the permissions are being requested during runtime, you'll still need to t
**Upgrade pre-1.12 Android projects**

Since version 4.4.0 this plugin is implemented using the Flutter 1.12 Android plugin APIs. Unfortunately, this means App developers also need to migrate their Apps to support the new Android infrastructure. You can do so by following the [Upgrading pre 1.12 Android projects](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects) migration guide. Failing to do so might result in unexpected behavior. The most common known error is the permission_handler not returning after calling the `.request()` method on permission.

**AndroidX**

As of version 3.1.0, the <kbd>permission_handler</kbd> plugin switched to the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility).

The TL;DR version is:

1. Add the following to your "gradle.properties" file:

```properties
android.useAndroidX=true
android.enableJetifier=true
```

2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 33:

2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to at least `36`: newer AndroidX artifacts (for example androidx.browser:browser:1.9.0 and androidx.core:core-ktx:1.17.0) require compiling against API 36 or later. Example:
```gradle
android {
compileSdkVersion 35
compileSdkVersion 36
...
}
```

3. Make sure you replace all the `android.` dependencies to their AndroidX counterparts (a full list can be found [here](https://developer.android.com/jetpack/androidx/migrate)).


3. If you see warnings from the Android Gradle Plugin about unsupported compileSdk versions, upgrade your Android Gradle Plugin (AGP) to a version that supports API 36 or later. We recommend using AGP 8.9.1 or newer and a compatible Gradle distribution (e.g. Gradle 8.11.1+).

4. Make sure you replace all the `android.` dependencies to their AndroidX counterparts (a full list can be found [here](https://developer.android.com/jetpack/androidx/migrate)).

Add permissions to your `AndroidManifest.xml` file.
There are `debug`, `main`, and `profile` versions which are chosen depending on how you start your app.
In general, it's sufficient to add permission only to the `main` version.
[Here](https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler/example/android/app/src/main/AndroidManifest.xml)'s an example `AndroidManifest.xml` with a complete list of all possible permissions.


**Troubleshooting build memory issues**

If you encounter Java heap space errors while building with newer AGP/Gradle, increase the Gradle JVM memory in `android/gradle.properties` for the app/project:

```properties
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
```

</details>

<details>
Expand Down
8 changes: 5 additions & 3 deletions permission_handler/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ android {
compileSdkVersion 36

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_18
targetCompatibility JavaVersion.VERSION_18
}
kotlinOptions {
jvmTarget = '18'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.baseflow.permissionhandler.example"
Expand Down
2 changes: 1 addition & 1 deletion permission_handler/example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
2 changes: 0 additions & 2 deletions permission_handler/example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
</dict>
</plist>
48 changes: 7 additions & 41 deletions permission_handler/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
platform :ios, '13.0'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
Expand Down Expand Up @@ -39,61 +36,30 @@ post_install do |installer|
flutter_additional_ios_build_settings(target)

target.build_configurations.each do |config|
# You can remove unused permissions here
# for more infomation: https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
# e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
# You can remove unused permissions here.
# For more information:
# https://github.com/Baseflow/flutter-permission-handler/blob/main/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',

## dart: [PermissionGroup.calendarWriteOnly, PermissionGroup.calendar (until iOS 16)]
'PERMISSION_EVENTS=1',

## dart: [PermissionGroup.calendarFullAccess, PermissionGroup.calendar (from iOS 17)]
'PERMISSION_EVENTS_FULL_ACCESS=1',

## dart: PermissionGroup.reminders
'PERMISSION_EVENTS_FULL_ACCESS=1',
'PERMISSION_REMINDERS=1',

## dart: PermissionGroup.contacts
'PERMISSION_CONTACTS=1',

## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',

## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',

## dart: PermissionGroup.speech
'PERMISSION_SPEECH_RECOGNIZER=1',

## dart: PermissionGroup.photos
'PERMISSION_PHOTOS=1',

## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
'PERMISSION_LOCATION=1',

## dart: PermissionGroup.notification
'PERMISSION_LOCATION_WHENINUSE=0',
'PERMISSION_NOTIFICATIONS=1',

## dart: PermissionGroup.mediaLibrary
'PERMISSION_MEDIA_LIBRARY=1',

## dart: PermissionGroup.sensors
'PERMISSION_SENSORS=1',

## dart: PermissionGroup.bluetooth
'PERMISSION_BLUETOOTH=1',

## dart: PermissionGroup.appTrackingTransparency
'PERMISSION_APP_TRACKING_TRANSPARENCY=1',

## dart: PermissionGroup.criticalAlerts
'PERMISSION_CRITICAL_ALERTS=1',

## dart: PermissionGroup.assistant
'PERMISSION_ASSISTANT=1',
]

end
end
end

Loading
Loading