Commit f9f6781e by Sebastian Roth

Merge branch 'develop' into ignore-battery-android-m

parents 89b59280 fb752f41
# This is a basic workflow to help you get started with Actions
name: app_facing_package
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
push:
branches: [ master, develop ]
paths:
- 'permission_handler/**'
pull_request:
branches: [ master, develop ]
paths:
- 'permission_handler/**'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Job configuration for the permission_handler (App Facing Package)
permission_handler:
# The type of runner that the job will run on
runs-on: macos-latest
env:
source-directory: ./permission_handler
example-directory: ./permission_handler/example
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
# Download all Flutter packages the permission_handler depends on
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed lib
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
- name: Run Flutter Analyzer
run: flutter analyze
working-directory: ${{env.source-directory}}
# Build Android version of the example app
- name: Run Android build
run: flutter build apk --release
working-directory: ${{env.example-directory}}
# Build iOS version of the example app
- name: Run iOS build
run: flutter build ios --release --no-codesign
working-directory: ${{env.example-directory}}
# This is a basic workflow to help you get started with Actions
name: platform_interface_package
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the develop branch
on:
push:
branches: [ master, develop ]
paths:
- 'permission_handler_platform_interface/**'
pull_request:
branches: [ master, develop ]
paths:
- 'permission_handler_platform_interface/**'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Job configuration for the permission_handler_platform_interface (Platform Interface Package)
permission_handler_platform_interface:
# The type of runner that the job will run on
runs-on: macos-latest
env:
source-directory: ./permission_handler_platform_interface
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Make sure the stable version of Flutter is available
- uses: subosito/flutter-action@v1
with:
channel: 'beta'
# Download all Flutter packages the permission_handler_platform_interface depends on
- name: Download dependencies
run: flutter pub get
working-directory: ${{env.source-directory}}
# Run Flutter Format to ensure formatting is valid
- name: Run Flutter Format
run: flutter format --set-exit-if-changed lib
working-directory: ${{env.source-directory}}
# Run Flutter Analyzer
- name: Run Flutter Analyzer
run: flutter analyze
working-directory: ${{env.source-directory}}
[![pub package](https://img.shields.io/pub/v/permission_handler.svg)](https://pub.dartlang.org/packages/permission_handler) [![Build Status](https://app.bitrise.io/app/fa4f5d4bf452bcfb/status.svg?token=HorGpL_AOw2llYz39CjmdQ&branch=master)](https://app.bitrise.io/app/fa4f5d4bf452bcfb) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) [![pub package](https://img.shields.io/pub/v/permission_handler.svg)](https://pub.dartlang.org/packages/permission_handler) ![Build status](https://github.com/Baseflow/flutter-permission-handler/workflows/permission_handler/badge.svg?branch=master) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
On most operating systems, permissions aren't just granted to apps at install time. On most operating systems, permissions aren't just granted to apps at install time.
Rather, developers have to ask the user for permissions while the app is running. Rather, developers have to ask the user for permissions while the app is running.
...@@ -40,7 +40,7 @@ android { ...@@ -40,7 +40,7 @@ android {
Add permissions to your `AndroidManifest.xml` file. Add permissions to your `AndroidManifest.xml` file.
There's a `debug`, `main` and `profile` version which are chosen depending on how you start your app. There's a `debug`, `main` and `profile` version which are chosen depending on how you start your app.
In general, it's sufficient to add permission only to the `main` version. In general, it's sufficient to add permission only to the `main` version.
[Here](https://github.com/Baseflow/flutter-permission-handler/blob/develop/example/android/app/src/main/AndroidManifest.xml)'s an example `AndroidManifest.xml` with a complete list of all possible permissions. [Here](https://github.com/Baseflow/flutter-permission-handler/blob/develop/permission_handler/example/android/app/src/main/AndroidManifest.xml)'s an example `AndroidManifest.xml` with a complete list of all possible permissions.
</details> </details>
...@@ -199,7 +199,7 @@ Please file any issues, bugs or feature request as an issue on our [GitHub](http ...@@ -199,7 +199,7 @@ Please file any issues, bugs or feature request as an issue on our [GitHub](http
## Want to contribute ## Want to contribute
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](../CONTRIBUTING.md) and send us your [pull request](https://github.com/Baseflow/flutter-permission-handler/pulls). If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](./CONTRIBUTING.md) and send us your [pull request](https://github.com/Baseflow/flutter-permission-handler/pulls).
## Author ## Author
......
# 5.0.1+1 ## 6.0.0
* Migrated to null safety
## 5.1.0+2
* Solve mismatch with permission constants between Dart and Android (due to addition of permission on iOS);
* Fix compile error which occurred when on iOS the "PERMISSION_PHOTOS" macro is deactivated (meaning code dealing with the `PHPhotoLibrary` library is removed from the code base).
## 5.1.0+1
* Recreate the iOS part of the example project based on the Flutter stable channel (previous version was accidentally created with the Flutter beta channel).
## 5.1.0
* Added support for the limited photos permission available on iOS 14 and up;
* Fixed deprecated warning on iOS;
* Added support for the "READ_PHONE_NUMBERS" permission on Android;
* Fix a link to the contribution guide in the README.md.
## 5.0.1+2
* Pin dependency on permission_handler_platform_interface on version 2.0.1.
## 5.0.1+1
* Fixes Typo * Fixes Typo
* Issue #233 - on 5.0: Solved a bug that prevented Android applications running in the background to check the permission status. * Issue #233 - on 5.0: Solved a bug that prevented Android applications running in the background to check the permission status.
# 5.0.1 ## 5.0.1
* Update `permission_handler_platform_interface 2.0.1` * Update `permission_handler_platform_interface 2.0.1`
# 5.0.0+hotfix.10 ## 5.0.0+hotfix.10
* Revert pull-request [#317](https://github.com/Baseflow/flutter-permission-handler/pull/317) * Revert pull-request [#317](https://github.com/Baseflow/flutter-permission-handler/pull/317)
# 5.0.0+hotfix.9 ## 5.0.0+hotfix.9
* Solved an issue where kCLAuthorizationStatusAuthorizedWhenInUse was returning PermissionStatusDenied (see [#317](https://github.com/Baseflow/flutter-permission-handler/pull/317)) * Solved an issue where kCLAuthorizationStatusAuthorizedWhenInUse was returning PermissionStatusDenied (see [#317](https://github.com/Baseflow/flutter-permission-handler/pull/317))
......
[![pub package](https://img.shields.io/pub/v/permission_handler.svg)](https://pub.dartlang.org/packages/permission_handler) [![Build Status](https://app.bitrise.io/app/fa4f5d4bf452bcfb/status.svg?token=HorGpL_AOw2llYz39CjmdQ&branch=master)](https://app.bitrise.io/app/fa4f5d4bf452bcfb) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) # permission_handler_platform_interface
On most operating systems, permissions aren't just granted to apps at install time. [![pub package](https://img.shields.io/pub/v/permission_handler.svg)](https://pub.dartlang.org/packages/permission_handler) ![Build status](https://github.com/Baseflow/flutter-permission-handler/workflows/app_facing_package/badge.svg?branch=master) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
Rather, developers have to ask the user for permissions while the app is running.
This plugin provides a cross-platform (iOS, Android) API to request permissions and check their status. A common platform interface for the [`permission_handler`][1] plugin.
You can also open the device's app settings so users can grant a permission.
On Android, you can show a rationale for requesting a permission.
## Setup This interface allows platform-specific implementations of the `permission_handler`
plugin, as well as the plugin itself, to ensure they are supporting the
same interface. Have a look at the [Federated plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins)
section of the official [Developing packages & plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages)
documentation for more information regarding the federated architecture concept.
While the permissions are being requested during runtime, you'll still need to tell the OS which permissions your app might potentially use. That requires adding permission configuration to Android- and iOS-specific files. ## Usage
<details> To implement a new platform-specific implementation of `permission_handler`, extend
<summary>Android</summary> [`PermissionHandlerPlatform`][2] with an implementation that performs the
platform-specific behavior, and when you register your plugin, set the default
**Upgrade pre 1.12 Android projects** `PermissionHandlerPlatform` by calling
`PermissionHandlerPlatform.instance = MyPlatformPermissionHandler()`.
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 behaviour. Most common known error is the permission_handler not returning after calling the `.request()` method on a permission.
**AndroidX** ## Note on breaking changes
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). Strongly prefer non-breaking changes (such as adding a method to the interface)
over breaking changes for this package.
The TL;DR version is: See https://flutter.dev/go/platform-interface-breaking-changes for a discussion
1. Add the following to your "gradle.properties" file: on why a less-clean interface is preferable to a breaking change.
```
android.useAndroidX=true
android.enableJetifier=true
```
2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 28:
```
android {
compileSdkVersion 28
...
}
```
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).
Add permissions to your `AndroidManifest.xml` file.
There's a `debug`, `main` and `profile` version 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/develop/example/android/app/src/main/AndroidManifest.xml))'s an example `AndroidManifest.xml` with a complete list of all possible permissions.
</details>
<details>
<summary>iOS</summary>
Add permission to your `Info.plist` file.
[Here](https://github.com/Baseflow/flutter-permission-handler/blob/develop/permission_handler/example/ios/Runner/Info.plist)'s an example `Info.plist` with a complete list of all possible permissions.
> IMPORTANT: ~~You will have to include all permission options when you want to submit your App.~~ This is because the `permission_handler` plugin touches all different SDKs and because the static code analyser (run by Apple upon App submission) detects this and will assert if it cannot find a matching permission option in the `Info.plist`. More information about this can be found [here](https://github.com/BaseflowIT/flutter-permission-handler/issues/26).
The <kbd>permission_handler</kbd> plugin use [macros](https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/permission_handler/ios/Classes/PermissionHandlerEnums.h) to control whether a permission is supported.
You can remove permissions you don't use:
1. Add the following to your `Podfile` file:
```ruby
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
... # Here are some configurations automatically generated by flutter
# You can remove unused permissions here
# for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/permission_handler/ios/Classes/PermissionHandlerEnums.h
# e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
# 'PERMISSION_EVENTS=0',
## dart: PermissionGroup.reminders
# 'PERMISSION_REMINDERS=0',
## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=0',
## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=0',
## dart: PermissionGroup.microphone
# 'PERMISSION_MICROPHONE=0',
## dart: PermissionGroup.speech
# 'PERMISSION_SPEECH_RECOGNIZER=0',
## dart: PermissionGroup.photos
# 'PERMISSION_PHOTOS=0',
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
# 'PERMISSION_LOCATION=0',
## dart: PermissionGroup.notification
# 'PERMISSION_NOTIFICATIONS=0',
## dart: PermissionGroup.mediaLibrary
# 'PERMISSION_MEDIA_LIBRARY=0',
## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=0'
]
end
end
end
```
2. Remove the `#` character in front of the permission you do not want to use. For example if you don't need access to the calendar make sure the code looks like this:
```ruby
## dart: PermissionGroup.calendar
'PERMISSION_EVENTS=0',
```
3. Delete the corresponding permission description in `Info.plist`
e.g. when you don't need camera permission, just delete 'NSCameraUsageDescription'
The following lists the relationship between `Permission` and `The key of Info.plist`:
| Permission | Info.plist | Macro |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| PermissionGroup.calendar | NSCalendarsUsageDescription | PERMISSION_EVENTS |
| PermissionGroup.reminders | NSRemindersUsageDescription | PERMISSION_REMINDERS |
| PermissionGroup.contacts | NSContactsUsageDescription | PERMISSION_CONTACTS |
| PermissionGroup.camera | NSCameraUsageDescription | PERMISSION_CAMERA |
| PermissionGroup.microphone | NSMicrophoneUsageDescription | PERMISSION_MICROPHONE |
| PermissionGroup.speech | NSSpeechRecognitionUsageDescription | PERMISSION_SPEECH_RECOGNIZER |
| PermissionGroup.photos | NSPhotoLibraryUsageDescription | PERMISSION_PHOTOS |
| PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse | NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription | PERMISSION_LOCATION |
| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS |
| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY |
| PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS |
4. Clean & Rebuild
</details>
## How to use
There are a number of [`Permission`](https://pub.dev/documentation/permission_handler_platform_interface/latest/permission_handler_platform_interface/Permission-class.html#constants)s.
You can get a `Permission`'s `status`, which is either `undetermined`, `granted`, `denied`, `restricted` or `permanentlyDenied`.
```dart
var status = await Permission.camera.status;
if (status.isUndetermined) {
// We didn't ask for permission yet.
}
// You can can also directly ask the permission about its status.
if (await Permission.location.isRestricted) {
// The OS restricts access, for example because of parental controls.
}
```
Call `request()` on a `Permission` to request it.
If it has already been granted before, nothing happens.
`request()` returns the new status of the `Permission`.
```dart
if (await Permission.contacts.request().isGranted) {
// Either the permission was already granted before or the user just granted it.
}
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.location,
Permission.storage,
].request();
print(statuses[Permission.location]);
```
Some permissions, for example location or acceleration sensor permissions, have an associated service, which can be `enabled` or `disabled`.
```dart
if (await Permission.locationWhenInUse.serviceStatus.isEnabled) {
// Use location.
}
```
You can also open the app settings:
```dart
if (await Permission.speech.isPermanentlyDenied) {
// The user opted to never again see the permission request dialog for this
// app. The only way to change the permission's status now is to let the
// user manually enable it in the system settings.
openAppSettings();
}
```
On Android, you can show a rationale for using a permission:
```dart
bool isShown = await Permission.contacts.shouldShowRequestRationale;
```
## Issues ## Issues
......
...@@ -21,16 +21,17 @@ final class PermissionConstants { ...@@ -21,16 +21,17 @@ final class PermissionConstants {
static final int PERMISSION_GROUP_MICROPHONE = 7; static final int PERMISSION_GROUP_MICROPHONE = 7;
static final int PERMISSION_GROUP_PHONE = 8; static final int PERMISSION_GROUP_PHONE = 8;
static final int PERMISSION_GROUP_PHOTOS = 9; static final int PERMISSION_GROUP_PHOTOS = 9;
static final int PERMISSION_GROUP_REMINDERS = 10; static final int PERMISSION_GROUP_PHOTOS_ADD_ONLY = 10;
static final int PERMISSION_GROUP_SENSORS = 11; static final int PERMISSION_GROUP_REMINDERS = 11;
static final int PERMISSION_GROUP_SMS = 12; static final int PERMISSION_GROUP_SENSORS = 12;
static final int PERMISSION_GROUP_SPEECH = 13; static final int PERMISSION_GROUP_SMS = 13;
static final int PERMISSION_GROUP_STORAGE = 14; static final int PERMISSION_GROUP_SPEECH = 14;
static final int PERMISSION_GROUP_IGNORE_BATTERY_OPTIMIZATIONS = 15; static final int PERMISSION_GROUP_STORAGE = 15;
static final int PERMISSION_GROUP_NOTIFICATION = 16; static final int PERMISSION_GROUP_IGNORE_BATTERY_OPTIMIZATIONS = 16;
static final int PERMISSION_GROUP_ACCESS_MEDIA_LOCATION = 17; static final int PERMISSION_GROUP_NOTIFICATION = 17;
static final int PERMISSION_GROUP_ACTIVITY_RECOGNITION = 18; static final int PERMISSION_GROUP_ACCESS_MEDIA_LOCATION = 18;
static final int PERMISSION_GROUP_UNKNOWN = 19; static final int PERMISSION_GROUP_ACTIVITY_RECOGNITION = 19;
static final int PERMISSION_GROUP_UNKNOWN = 20;
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef({ @IntDef({
...@@ -63,7 +64,8 @@ final class PermissionConstants { ...@@ -63,7 +64,8 @@ final class PermissionConstants {
static final int PERMISSION_STATUS_GRANTED = 1; static final int PERMISSION_STATUS_GRANTED = 1;
static final int PERMISSION_STATUS_RESTRICTED = 2; static final int PERMISSION_STATUS_RESTRICTED = 2;
static final int PERMISSION_STATUS_NOT_DETERMINED = 3; static final int PERMISSION_STATUS_NOT_DETERMINED = 3;
static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 4; static final int PERMISSION_STATUS_LIMITED = 4;
static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 5;
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef({ @IntDef({
...@@ -71,7 +73,8 @@ final class PermissionConstants { ...@@ -71,7 +73,8 @@ final class PermissionConstants {
PERMISSION_STATUS_GRANTED, PERMISSION_STATUS_GRANTED,
PERMISSION_STATUS_RESTRICTED, PERMISSION_STATUS_RESTRICTED,
PERMISSION_STATUS_NOT_DETERMINED, PERMISSION_STATUS_NOT_DETERMINED,
PERMISSION_STATUS_NEVER_ASK_AGAIN, PERMISSION_STATUS_LIMITED,
PERMISSION_STATUS_NEVER_ASK_AGAIN,
}) })
@interface PermissionStatus { @interface PermissionStatus {
} }
......
...@@ -38,6 +38,7 @@ public class PermissionUtils { ...@@ -38,6 +38,7 @@ public class PermissionUtils {
case Manifest.permission.RECORD_AUDIO: case Manifest.permission.RECORD_AUDIO:
return PermissionConstants.PERMISSION_GROUP_MICROPHONE; return PermissionConstants.PERMISSION_GROUP_MICROPHONE;
case Manifest.permission.READ_PHONE_STATE: case Manifest.permission.READ_PHONE_STATE:
case Manifest.permission.READ_PHONE_NUMBERS:
case Manifest.permission.CALL_PHONE: case Manifest.permission.CALL_PHONE:
case Manifest.permission.READ_CALL_LOG: case Manifest.permission.READ_CALL_LOG:
case Manifest.permission.WRITE_CALL_LOG: case Manifest.permission.WRITE_CALL_LOG:
...@@ -118,6 +119,10 @@ public class PermissionUtils { ...@@ -118,6 +119,10 @@ public class PermissionUtils {
if (hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_STATE)) if (hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_STATE))
permissionNames.add(Manifest.permission.READ_PHONE_STATE); permissionNames.add(Manifest.permission.READ_PHONE_STATE);
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.Q && hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_NUMBERS)) {
permissionNames.add(Manifest.permission.READ_PHONE_NUMBERS);
}
if (hasPermissionInManifest(context, permissionNames, Manifest.permission.CALL_PHONE)) if (hasPermissionInManifest(context, permissionNames, Manifest.permission.CALL_PHONE))
permissionNames.add(Manifest.permission.CALL_PHONE); permissionNames.add(Manifest.permission.CALL_PHONE);
......
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.permissionhandlerexample">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
package com.example.example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>App</string> <string>App</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
# #
# NOTE: This podspec is NOT to be published. It is only used as a local source! # NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Flutter' s.name = 'Flutter'
s.version = '1.0.0' s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.' s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io' s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' } s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0' s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework' # Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end end
...@@ -10,75 +10,75 @@ project 'Runner', { ...@@ -10,75 +10,75 @@ project 'Runner', {
'Release' => :release, 'Release' => :release,
} }
def parse_KV_file(file, separator='=') def flutter_root
file_abs_path = File.expand_path(file) generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
if !File.exists? file_abs_path unless File.exist?(generated_xcode_build_settings_path)
return []; raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"] File.foreach(generated_xcode_build_settings_path) do |line|
File.foreach(file_abs_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/)
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } return matches[1].strip if matches
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end end
generated_key_values raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end end
target 'Runner' do require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path) flutter_ios_podfile_setup
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods target 'Runner' do
use_frameworks!
use_modular_headers!
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config| target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO' # You can remove unused permissions here
# for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/permission_handler/ios/Classes/PermissionHandlerEnums.h
# e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
# 'PERMISSION_EVENTS=0',
## dart: PermissionGroup.reminders
# 'PERMISSION_REMINDERS=0',
## dart: PermissionGroup.contacts
# 'PERMISSION_CONTACTS=0',
## dart: PermissionGroup.camera
# 'PERMISSION_CAMERA=0',
## dart: PermissionGroup.microphone
# 'PERMISSION_MICROPHONE=0',
## dart: PermissionGroup.speech
# 'PERMISSION_SPEECH_RECOGNIZER=0',
## dart: PermissionGroup.photos
#'PERMISSION_PHOTOS=0'
## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
# 'PERMISSION_LOCATION=0',
## dart: PermissionGroup.notification
# 'PERMISSION_NOTIFICATIONS=0',
## dart: PermissionGroup.mediaLibrary
# 'PERMISSION_MEDIA_LIBRARY=0',
## dart: PermissionGroup.sensors
# 'PERMISSION_SENSORS=0'
]
end end
end end
end end
...@@ -3,18 +3,17 @@ ...@@ -3,18 +3,17 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 46; objectVersion = 51;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B7634AD7E1771AEDD2D1A5F7 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D132729FF349998420355A35 /* libPods-Runner.a */; }; B501E7F22BA22C455255CE2E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C446183715B92022DDB68882 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -34,21 +33,20 @@ ...@@ -34,21 +33,20 @@
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
4B425729EC83DC3B462CA8DE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 862A53EA392D32566500E869 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
7F75CD7F5600A279408DF048 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
89CBFAE60E5774D9B3D21DEF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D132729FF349998420355A35 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C446183715B92022DDB68882 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CEA40B36DE135D81D16B7399 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
DA7CB50DE8057A7A8D126AC9 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -56,17 +54,27 @@ ...@@ -56,17 +54,27 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B7634AD7E1771AEDD2D1A5F7 /* libPods-Runner.a in Frameworks */, B501E7F22BA22C455255CE2E /* Pods_Runner.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
55A8F50F97AFD5E34636A6AC /* Frameworks */ = { 2982F40ECD3DD26A4434B596 /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D132729FF349998420355A35 /* libPods-Runner.a */, CEA40B36DE135D81D16B7399 /* Pods-Runner.debug.xcconfig */,
862A53EA392D32566500E869 /* Pods-Runner.release.xcconfig */,
DA7CB50DE8057A7A8D126AC9 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
7EF8E4A69F95E4BF7F747BE9 /* Frameworks */ = {
isa = PBXGroup;
children = (
C446183715B92022DDB68882 /* Pods_Runner.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -88,8 +96,8 @@ ...@@ -88,8 +96,8 @@
9740EEB11CF90186004384FC /* Flutter */, 9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */, 97C146EF1CF9000F007C117D /* Products */,
EDB9D82C0C7AC839E456BFF1 /* Pods */, 2982F40ECD3DD26A4434B596 /* Pods */,
55A8F50F97AFD5E34636A6AC /* Frameworks */, 7EF8E4A69F95E4BF7F747BE9 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
...@@ -104,37 +112,18 @@ ...@@ -104,37 +112,18 @@
97C146F01CF9000F007C117D /* Runner */ = { 97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */, 97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
); );
path = Runner; path = Runner;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
97C146F21CF9000F007C117D /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
EDB9D82C0C7AC839E456BFF1 /* Pods */ = {
isa = PBXGroup;
children = (
7F75CD7F5600A279408DF048 /* Pods-Runner.debug.xcconfig */,
89CBFAE60E5774D9B3D21DEF /* Pods-Runner.release.xcconfig */,
4B425729EC83DC3B462CA8DE /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
...@@ -142,14 +131,14 @@ ...@@ -142,14 +131,14 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
CD618854C236B3F0FBC77F28 /* [CP] Check Pods Manifest.lock */, 5CF31A8C72B66ABB365E813D /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
8BA3EF5BA9C129C83EB3F474 /* [CP] Embed Pods Frameworks */, D38B08CB85942E5D11545EE3 /* [CP] Embed Pods Frameworks */,
); );
buildRules = ( buildRules = (
); );
...@@ -167,20 +156,19 @@ ...@@ -167,20 +156,19 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 1020; LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 7624MWN53C; LastSwiftMigration = 1100;
}; };
}; };
}; };
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 9.3";
developmentRegion = English; developmentRegion = en;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
English,
en, en,
Base, Base,
); );
...@@ -223,22 +211,26 @@ ...@@ -223,22 +211,26 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
}; };
8BA3EF5BA9C129C83EB3F474 /* [CP] Embed Pods Frameworks */ = { 5CF31A8C72B66ABB365E813D /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = (
);
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/../Flutter/Flutter.framework", "${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
); );
name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
...@@ -255,26 +247,21 @@ ...@@ -255,26 +247,21 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
}; };
CD618854C236B3F0FBC77F28 /* [CP] Check Pods Manifest.lock */ = { D38B08CB85942E5D11545EE3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = ( name = "[CP] Embed Pods Frameworks";
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = ( outputFileListPaths = (
); "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
...@@ -284,8 +271,7 @@ ...@@ -284,8 +271,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
97C146F31CF9000F007C117D /* main.m in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -314,10 +300,8 @@ ...@@ -314,10 +300,8 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
...@@ -355,9 +339,10 @@ ...@@ -355,9 +339,10 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
...@@ -368,31 +353,34 @@ ...@@ -368,31 +353,34 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7624MWN53C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.permissionHandlerExample; PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Profile; name = Profile;
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
...@@ -436,7 +424,7 @@ ...@@ -436,7 +424,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
...@@ -446,10 +434,8 @@ ...@@ -446,10 +434,8 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
...@@ -487,9 +473,12 @@ ...@@ -487,9 +473,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
}; };
...@@ -500,21 +489,27 @@ ...@@ -500,21 +489,27 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7624MWN53C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.permissionHandlerExample; PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
...@@ -524,21 +519,26 @@ ...@@ -524,21 +519,26 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 7624MWN53C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.permissionHandlerExample; PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : FlutterAppDelegate
@end
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>permission_handler_example</string> <string>example</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<!-- Permission options for the `location` group --> <!-- Permission options for the `location` group -->
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string>Need location when in use</string> <string>Need location when in use</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array/>
</dict>
</plist>
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char* argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:flutter/widgets.dart';
import 'template/globals.dart';
void main() {
runApp(BaseflowPluginExample());
}
void main() => runApp(MyApp()); /// A Flutter application demonstrating the functionality of this plugin
class BaseflowPluginExample extends StatelessWidget {
/// [MaterialColor] to be used in the app [ThemeData]
final MaterialColor themeMaterialColor =
createMaterialColor(const Color.fromRGBO(48, 49, 60, 1));
/// Example Flutter Application demonstrating the functionality of the
/// Permission Handler plugin.
class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
home: Scaffold( title: 'Baseflow $pluginName',
appBar: AppBar( theme: ThemeData(
title: const Text('Plugin example app'), accentColor: Colors.white60,
actions: <Widget>[ backgroundColor: const Color.fromRGBO(48, 49, 60, 0.8),
IconButton( buttonTheme: ButtonThemeData(
icon: const Icon(Icons.settings), buttonColor: themeMaterialColor.shade500,
onPressed: () async { disabledColor: themeMaterialColor.withRed(200),
var hasOpened = openAppSettings(); splashColor: themeMaterialColor.shade50,
debugPrint('App Settings opened: ' + hasOpened.toString()); textTheme: ButtonTextTheme.primary,
}, ),
) bottomAppBarColor: const Color.fromRGBO(57, 58, 71, 1),
], hintColor: themeMaterialColor.shade500,
primarySwatch: createMaterialColor(const Color.fromRGBO(48, 49, 60, 1)),
textTheme: TextTheme(
bodyText1: TextStyle(
color: Colors.white,
fontSize: 16,
height: 1.3,
),
bodyText2: TextStyle(
color: Colors.white,
fontSize: 18,
height: 1.2,
),
button: TextStyle(color: Colors.white),
headline1: TextStyle(
color: Colors.white,
fontSize: 18,
),
), ),
body: Center( visualDensity: VisualDensity.adaptivePlatformDensity,
child: ListView( inputDecorationTheme: InputDecorationTheme(
children: Permission.values fillColor: const Color.fromRGBO(37, 37, 37, 1),
.where((Permission permission) { filled: true,
if (Platform.isIOS) {
return permission != Permission.unknown &&
permission != Permission.sms &&
//permission != Permission.storage &&
permission != Permission.ignoreBatteryOptimizations &&
permission != Permission.accessMediaLocation;
} else {
return permission != Permission.unknown &&
permission != Permission.mediaLibrary &&
permission != Permission.photos &&
permission != Permission.reminders;
}
})
.map((permission) => PermissionWidget(permission))
.toList()),
), ),
), ),
home: AppHome(title: 'Baseflow $pluginName example app'),
); );
} }
}
/// Permission widget which displays a permission and allows users to request /// Creates a [MaterialColor] based on the supplied [Color]
/// the permissions. static MaterialColor createMaterialColor(Color color) {
class PermissionWidget extends StatefulWidget { List strengths = <double>[.05];
/// Constructs a [PermissionWidget] for the supplied [Permission]. Map swatch = <int, Color>{};
const PermissionWidget(this._permission); final r = color.red, g = color.green, b = color.blue;
final Permission _permission; for (var i = 1; i < 10; i++) {
strengths.add(0.1 * i);
@override }
_PermissionState createState() => _PermissionState(_permission); for (var strength in strengths) {
final ds = 0.5 - strength;
swatch[(strength * 1000).round()] = Color.fromRGBO(
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
1,
);
}
return MaterialColor(color.value, swatch as Map<int, Color>);
}
} }
class _PermissionState extends State<PermissionWidget> { /// A Flutter example demonstrating how the [pluginName] plugin could be used
_PermissionState(this._permission); class AppHome extends StatefulWidget {
/// Constructs the [AppHome] class
AppHome({Key? key, this.title}) : super(key: key);
final Permission _permission; /// The [title] of the application, which is shown in the application's
PermissionStatus _permissionStatus = PermissionStatus.undetermined; /// title bar.
final String? title;
@override @override
void initState() { _AppHomeState createState() => _AppHomeState();
super.initState(); }
_listenForPermissionStatus();
}
void _listenForPermissionStatus() async {
final status = await _permission.status;
setState(() => _permissionStatus = status);
}
Color getPermissionColor() { class _AppHomeState extends State<AppHome> {
switch (_permissionStatus) { static final PageController _pageController = PageController(initialPage: 0);
case PermissionStatus.denied: int _currentPage = 0;
return Colors.red;
case PermissionStatus.granted:
return Colors.green;
default:
return Colors.grey;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListTile( return Scaffold(
title: Text(_permission.toString()), appBar: AppBar(
subtitle: Text( backgroundColor: Theme.of(context).bottomAppBarColor,
_permissionStatus.toString(), title: Center(
style: TextStyle(color: getPermissionColor()), child: Image.asset(
'res/images/baseflow_logo_def_light-02.png',
width: 140,
),
),
),
backgroundColor: Theme.of(context).backgroundColor,
body: PageView(
controller: _pageController,
children: pages,
onPageChanged: (page) {
setState(() {
_currentPage = page;
});
},
), ),
trailing: IconButton( bottomNavigationBar: _bottomAppBar(),
icon: const Icon(Icons.info),
onPressed: () {
checkServiceStatus(context, _permission);
}),
onTap: () {
requestPermission(_permission);
},
); );
} }
void checkServiceStatus(BuildContext context, Permission permission) async { BottomAppBar _bottomAppBar() {
Scaffold.of(context).showSnackBar(SnackBar( return BottomAppBar(
content: Text((await permission.status).toString()), elevation: 5,
)); color: Theme.of(context).bottomAppBarColor,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.unmodifiable(() sync* {
for (var i = 0; i < pages.length; i++) {
yield Expanded(
child: IconButton(
iconSize: 30,
icon: Icon(icons.elementAt(i)),
color: _bottomAppBarIconColor(i),
onPressed: () => _animateToPage(i),
),
);
}
}()),
),
);
} }
Future<void> requestPermission(Permission permission) async { void _animateToPage(int page) {
final status = await permission.request(); _pageController.animateToPage(page,
duration: Duration(milliseconds: 200), curve: Curves.linear);
}
setState(() { Color _bottomAppBarIconColor(int page) {
print(status); return _currentPage == page ? Colors.white : Theme.of(context).accentColor;
_permissionStatus = status;
print(_permissionStatus);
});
} }
} }
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'permission_widget.dart';
/// Constructs a [ListView] containing [PermissionWidget] for each available
/// permission.
class PermissionList extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: ListView(
children: Permission.values
.where((permission) {
if (Platform.isIOS) {
return permission != Permission.unknown &&
permission != Permission.sms &&
//permission != Permission.storage &&
permission != Permission.ignoreBatteryOptimizations &&
permission != Permission.accessMediaLocation;
} else {
return permission != Permission.unknown &&
permission != Permission.mediaLibrary &&
permission != Permission.photos &&
permission != Permission.reminders;
}
})
.map((permission) => PermissionWidget(permission))
.toList()),
);
}
}
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
/// Permission widget which displays a permission and allows users to request
/// the permissions.
class PermissionWidget extends StatefulWidget {
/// Constructs a [PermissionWidget] for the supplied [Permission].
const PermissionWidget(this._permission);
final Permission _permission;
@override
_PermissionState createState() => _PermissionState(_permission);
}
class _PermissionState extends State<PermissionWidget> {
_PermissionState(this._permission);
final Permission _permission;
PermissionStatus _permissionStatus = PermissionStatus.undetermined;
@override
void initState() {
super.initState();
_listenForPermissionStatus();
}
void _listenForPermissionStatus() async {
final status = await _permission.status;
setState(() => _permissionStatus = status);
}
Color getPermissionColor() {
switch (_permissionStatus) {
case PermissionStatus.denied:
return Colors.red;
case PermissionStatus.granted:
return Colors.green;
case PermissionStatus.limited:
return Colors.orange;
default:
return Colors.grey;
}
}
@override
Widget build(BuildContext context) {
return ListTile(
title: Text(
_permission.toString(),
style: Theme.of(context).textTheme.bodyText1,
),
subtitle: Text(
_permissionStatus.toString(),
style: TextStyle(color: getPermissionColor()),
),
trailing: IconButton(
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () {
checkServiceStatus(context, _permission);
}),
onTap: () {
requestPermission(_permission);
},
);
}
void checkServiceStatus(BuildContext context, Permission permission) async {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text((await permission.status).toString()),
));
}
Future<void> requestPermission(Permission permission) async {
final status = await permission.request();
setState(() {
print(status);
_permissionStatus = status;
print(_permissionStatus);
});
}
}
import 'dart:core';
import 'package:flutter/material.dart';
import '../plugin_example/permission_list.dart';
import 'info_page.dart';
/// The name of the plugin, which will be displayed throughout the example App.
const String pluginName = 'Permission Handler';
/// Returns Github URL, which is shown in the [InfoPage].
const String githubURL =
'https://github.com/Baseflow/flutter-permission-handler';
/// Returns Baseflow URL, which is shown in the [InfoPage].
const String baseflowURL = 'https://baseflow.com';
/// Returns pub.dev URL, which is shown in the [InfoPage].
const String pubDevURL = 'https://pub.dev/packages/permission_handler';
/// [EdgeInsets] to define horizontal padding throughout the application.
const EdgeInsets defaultHorizontalPadding =
EdgeInsets.symmetric(horizontal: 24);
/// [EdgeInsets] to define vertical padding throughout the application.
const EdgeInsets defaultVerticalPadding = EdgeInsets.symmetric(vertical: 24);
/// Returns a [List] with [IconData] to show in the [AppHome] [AppBar].
final List<IconData> icons = [
Icons.list,
Icons.info_outline,
];
/// Returns a [List] with [Widget]s to construct pages in the [AppBar].
final List<Widget> pages = [
PermissionList(),
InfoPage(),
];
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:url_launcher/url_launcher.dart';
import 'globals.dart';
/// [StatelessWidget] displaying information about Baseflow
class InfoPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox.expand(
child: Align(
alignment: Alignment.bottomCenter,
child: SingleChildScrollView(
child: Padding(
padding: defaultHorizontalPadding + defaultVerticalPadding,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Image.asset(
'res/images/poweredByBaseflowLogoLight@3x.png',
width: 250,
alignment: Alignment.centerLeft,
),
),
const Padding(
padding: EdgeInsets.symmetric(vertical: 24),
),
Text(
'This app showcases the possibilities of the $pluginName '
'plugin, powered by Baseflow. '
'This plugin is available as open source project on Github. '
'\n\n'
'Need help with integrating functionalities within your own '
'apps? Contact us at hello@baseflow.com',
style: Theme.of(context).textTheme.bodyText1,
),
const Padding(
padding: EdgeInsets.symmetric(vertical: 8),
),
_launcherRaisedButton(
'Find us on Github',
githubURL,
context,
),
_launcherRaisedButton(
'Find us on pub.dev',
pubDevURL,
context,
),
_launcherRaisedButton(
'Visit baseflow.com',
baseflowURL,
context,
),
const Padding(
padding: EdgeInsets.only(bottom: 30),
),
],
),
),
),
),
);
}
Widget _launcherRaisedButton(String text, String url, BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width,
height: 50,
margin: const EdgeInsets.only(top: 24.0),
alignment: Alignment.center,
child: SizedBox.expand(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
),
child: Text(text),
onPressed: () => _launchURL(url),
),
),
);
}
Future<void> _launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
}
...@@ -2,7 +2,7 @@ name: permission_handler_example ...@@ -2,7 +2,7 @@ name: permission_handler_example
description: Demonstrates how to use the permission_handler plugin. description: Demonstrates how to use the permission_handler plugin.
environment: environment:
sdk: ">=2.1.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
dependencies: dependencies:
flutter: flutter:
...@@ -15,5 +15,12 @@ dev_dependencies: ...@@ -15,5 +15,12 @@ dev_dependencies:
permission_handler: permission_handler:
path: ../ path: ../
url_launcher: ^6.0.0
flutter: flutter:
uses-material-design: true uses-material-design: true
assets:
- res/images/baseflow_logo_def_light-02.png
- res/images/poweredByBaseflowLogoLight@3x.png
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -54,6 +54,13 @@ ...@@ -54,6 +54,13 @@
#define PERMISSION_PHOTOS 1 #define PERMISSION_PHOTOS 1
#endif #endif
// ios: PermissionGroupPhotosAddOnly
// Info.plist: NSPhotoLibraryUsageDescription
// dart: PermissionGroup.photosAddOnly
#ifndef PERMISSION_PHOTOS_ADD_ONLY
#define PERMISSION_PHOTOS_ADD_ONLY 1
#endif
// ios: [PermissionGroupLocation, PermissionGroupLocationAlways, PermissionGroupLocationWhenInUse] // ios: [PermissionGroupLocation, PermissionGroupLocationAlways, PermissionGroupLocationWhenInUse]
// Info.plist: [NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription] // Info.plist: [NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription]
// dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] // dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
...@@ -92,6 +99,7 @@ typedef NS_ENUM(int, PermissionGroup) { ...@@ -92,6 +99,7 @@ typedef NS_ENUM(int, PermissionGroup) {
PermissionGroupMicrophone, PermissionGroupMicrophone,
PermissionGroupPhone, PermissionGroupPhone,
PermissionGroupPhotos, PermissionGroupPhotos,
PermissionGroupPhotosAddOnly,
PermissionGroupReminders, PermissionGroupReminders,
PermissionGroupSensors, PermissionGroupSensors,
PermissionGroupSms, PermissionGroupSms,
...@@ -108,6 +116,7 @@ typedef NS_ENUM(int, PermissionStatus) { ...@@ -108,6 +116,7 @@ typedef NS_ENUM(int, PermissionStatus) {
PermissionStatusGranted, PermissionStatusGranted,
PermissionStatusRestricted, PermissionStatusRestricted,
PermissionStatusNotDetermined, PermissionStatusNotDetermined,
PermissionStatusLimited,
}; };
typedef NS_ENUM(int, ServiceStatus) { typedef NS_ENUM(int, ServiceStatus) {
......
...@@ -32,13 +32,19 @@ ...@@ -32,13 +32,19 @@
} }
- (void)requestPermissions:(NSArray *)permissions completion:(PermissionRequestCompletion)completion { - (void)requestPermissions:(NSArray *)permissions completion:(PermissionRequestCompletion)completion {
NSMutableSet *requestQueue = [[NSMutableSet alloc] initWithArray:permissions];
NSMutableDictionary *permissionStatusResult = [[NSMutableDictionary alloc] init]; NSMutableDictionary *permissionStatusResult = [[NSMutableDictionary alloc] init];
if (permissions.count == 0) {
completion(permissionStatusResult);
return;
}
NSMutableSet *requestQueue = [[NSMutableSet alloc] initWithArray:permissions];
for (int i = 0; i < permissions.count; ++i) { for (int i = 0; i < permissions.count; ++i) {
PermissionGroup value; NSNumber *rawNumberValue = permissions[i];
[permissions[i] getValue:&value]; int rawValue = rawNumberValue.intValue;
PermissionGroup permission = value; PermissionGroup permission = (PermissionGroup) rawValue;
id <PermissionStrategy> permissionStrategy = [PermissionManager createPermissionStrategy:permission]; id <PermissionStrategy> permissionStrategy = [PermissionManager createPermissionStrategy:permission];
[_strategyInstances addObject:permissionStrategy]; [_strategyInstances addObject:permissionStrategy];
...@@ -96,7 +102,17 @@ ...@@ -96,7 +102,17 @@
case PermissionGroupPhone: case PermissionGroupPhone:
return [PhonePermissionStrategy new]; return [PhonePermissionStrategy new];
case PermissionGroupPhotos: case PermissionGroupPhotos:
#if PERMISSION_PHOTOS
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:false];
#else
return [PhotoPermissionStrategy new]; return [PhotoPermissionStrategy new];
#endif
case PermissionGroupPhotosAddOnly:
#if PERMISSION_PHOTOS
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:true];
#else
return [PhotoPermissionStrategy new];
#endif
case PermissionGroupReminders: case PermissionGroupReminders:
return [EventPermissionStrategy new]; return [EventPermissionStrategy new];
case PermissionGroupSensors: case PermissionGroupSensors:
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import <Photos/Photos.h> #import <Photos/Photos.h>
@interface PhotoPermissionStrategy : NSObject <PermissionStrategy> @interface PhotoPermissionStrategy : NSObject <PermissionStrategy>
-(instancetype)initWithAccessAddOnly:(BOOL) addOnly;
@end @end
#else #else
......
...@@ -7,9 +7,21 @@ ...@@ -7,9 +7,21 @@
#if PERMISSION_PHOTOS #if PERMISSION_PHOTOS
@implementation PhotoPermissionStrategy @implementation PhotoPermissionStrategy{
bool addOnlyAccessLevel;
}
- (instancetype)initWithAccessAddOnly:(BOOL)addOnly {
self = [super init];
if(self) {
addOnlyAccessLevel = addOnly;
}
return self;
}
- (PermissionStatus)checkPermissionStatus:(PermissionGroup)permission { - (PermissionStatus)checkPermissionStatus:(PermissionGroup)permission {
return [PhotoPermissionStrategy permissionStatus]; return [PhotoPermissionStrategy permissionStatus:addOnlyAccessLevel];
} }
- (ServiceStatus)checkServiceStatus:(PermissionGroup)permission { - (ServiceStatus)checkServiceStatus:(PermissionGroup)permission {
...@@ -24,13 +36,24 @@ ...@@ -24,13 +36,24 @@
return; return;
} }
if(@available(iOS 14, *)) {
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus authorizationStatus) {
completionHandler([PhotoPermissionStrategy determinePermissionStatus:authorizationStatus]);
}];
}else {
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus authorizationStatus) { [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus authorizationStatus) {
completionHandler([PhotoPermissionStrategy determinePermissionStatus:authorizationStatus]); completionHandler([PhotoPermissionStrategy determinePermissionStatus:authorizationStatus]);
}]; }];
}
} }
+ (PermissionStatus)permissionStatus { + (PermissionStatus)permissionStatus:(BOOL) addOnlyAccessLevel {
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus]; PHAuthorizationStatus status;
if(@available(iOS 14, *)){
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
}else {
status = [PHPhotoLibrary authorizationStatus];
}
return [PhotoPermissionStrategy determinePermissionStatus:status]; return [PhotoPermissionStrategy determinePermissionStatus:status];
} }
...@@ -45,6 +68,8 @@ ...@@ -45,6 +68,8 @@
return PermissionStatusDenied; return PermissionStatusDenied;
case PHAuthorizationStatusAuthorized: case PHAuthorizationStatusAuthorized:
return PermissionStatusGranted; return PermissionStatusGranted;
case PHAuthorizationStatusLimited:
return PermissionStatusLimited;
} }
return PermissionStatusNotDetermined; return PermissionStatusNotDetermined;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'permission_handler' s.name = 'permission_handler'
s.version = '5.0.1+1' s.version = '5.1.0+2'
s.summary = 'Permission plugin for Flutter.' s.summary = 'Permission plugin for Flutter.'
s.description = <<-DESC s.description = <<-DESC
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions. Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
......
...@@ -23,8 +23,8 @@ Future<bool> openAppSettings() => _handler.openAppSettings(); ...@@ -23,8 +23,8 @@ Future<bool> openAppSettings() => _handler.openAppSettings();
/// Actions that can be executed on a permission. /// Actions that can be executed on a permission.
extension PermissionActions on Permission { extension PermissionActions on Permission {
/// The current status of this permission. /// The current status of this permission.
/// ///
/// The Android-only [PermissionStatus.permanentlyDenied] status will only be /// The Android-only [PermissionStatus.permanentlyDenied] status will only be
/// calculated if the active context is an Activity. If it isn't, /// calculated if the active context is an Activity. If it isn't,
/// [PermissionStatus.denied] will be returned. /// [PermissionStatus.denied] will be returned.
Future<PermissionStatus> get status => _handler.checkPermissionStatus(this); Future<PermissionStatus> get status => _handler.checkPermissionStatus(this);
...@@ -46,7 +46,8 @@ extension PermissionActions on Permission { ...@@ -46,7 +46,8 @@ extension PermissionActions on Permission {
/// ///
/// Returns the new [PermissionStatus]. /// Returns the new [PermissionStatus].
Future<PermissionStatus> request() async { Future<PermissionStatus> request() async {
return (await [this].request())[this]; final permissionStatus = (await [this].request())[this];
return permissionStatus ?? PermissionStatus.denied;
} }
} }
...@@ -67,6 +68,10 @@ extension PermissionCheckShortcuts on Permission { ...@@ -67,6 +68,10 @@ extension PermissionCheckShortcuts on Permission {
/// *Only supported on iOS.* /// *Only supported on iOS.*
Future<bool> get isRestricted => status.isRestricted; Future<bool> get isRestricted => status.isRestricted;
///User has authorized this application for limited photo library access.
/// *Only supported on iOS.(iOS14+)*
Future<bool> get isLimited => status.isLimited;
/// If the user denied this permission and selected to never again show a /// If the user denied this permission and selected to never again show a
/// request for it. The user may still change the permission's status in the /// request for it. The user may still change the permission's status in the
/// device settings. /// device settings.
......
name: permission_handler name: permission_handler
description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions. description: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
version: 5.0.1+1 version: 6.0.0
homepage: https://github.com/baseflowit/flutter-permission-handler homepage: https://github.com/baseflowit/flutter-permission-handler
flutter: flutter:
...@@ -15,13 +15,13 @@ flutter: ...@@ -15,13 +15,13 @@ flutter:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
meta: ^1.1.6 meta: ^1.3.0
permission_handler_platform_interface: ^2.0.1 permission_handler_platform_interface: ^3.0.0
dev_dependencies: dev_dependencies:
effective_dart: ^1.2.1 effective_dart: ^1.3.0
plugin_platform_interface: ^1.0.1 plugin_platform_interface: ^2.0.0
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.8 <2.0.0" flutter: ">=1.12.8 <2.0.0"
## 3.0.0+1
* **BREAKING**: Removed PermissionStatus.undetermined. This is now replaced by PermissionStatus.denied.
## 3.0.0
* Migrated to null safety.
## 2.0.2
* Added support for the limited photos permission available on iOS 14 and up.
## 2.0.1 ## 2.0.1
* Update `platform_interface 1.0.2` * Update `platform_interface 1.0.2`
......
# permission_handler_platform_interface # permission_handler_platform_interface
[![pub package](https://img.shields.io/pub/v/permission_handler_platform_interface.svg)](https://pub.dartlang.org/packages/permission_handler_platform_interface) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart) [![pub package](https://img.shields.io/pub/v/permission_handler_platform_interface.svg)](https://pub.dartlang.org/packages/permission_handler_platform_interface) ![Build status](https://github.com/Baseflow/flutter-permission-handler/workflows/platform_interface_package/badge.svg?branch=master) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
A common platform interface for the [`permission_handler`][1] plugin. A common platform interface for the [`permission_handler`][1] plugin.
......
...@@ -52,7 +52,8 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform { ...@@ -52,7 +52,8 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform {
/// [false]. /// [false].
Future<bool> openAppSettings() async { Future<bool> openAppSettings() async {
final wasOpened = await _methodChannel.invokeMethod('openAppSettings'); final wasOpened = await _methodChannel.invokeMethod('openAppSettings');
return wasOpened;
return wasOpened ?? false;
} }
/// Requests the user for access to the supplied list of [Permission]s, if /// Requests the user for access to the supplied list of [Permission]s, if
...@@ -77,6 +78,6 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform { ...@@ -77,6 +78,6 @@ class MethodChannelPermissionHandler extends PermissionHandlerPlatform {
final shouldShowRationale = await _methodChannel.invokeMethod( final shouldShowRationale = await _methodChannel.invokeMethod(
'shouldShowRequestPermissionRationale', permission.value); 'shouldShowRequestPermissionRationale', permission.value);
return shouldShowRationale; return shouldShowRationale ?? false;
} }
} }
...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface; ...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface;
/// Defines the state of a [Permission]. /// Defines the state of a [Permission].
enum PermissionStatus { enum PermissionStatus {
/// The permission wasn't requested yet.
undetermined,
/// The user granted access to the requested feature. /// The user granted access to the requested feature.
granted, granted,
...@@ -17,6 +14,10 @@ enum PermissionStatus { ...@@ -17,6 +14,10 @@ enum PermissionStatus {
/// *Only supported on iOS.* /// *Only supported on iOS.*
restricted, restricted,
///User has authorized this application for limited access.
/// *Only supported on iOS (iOS14+).*
limited,
/// The user denied access to the requested feature and selected to never /// The user denied access to the requested feature and selected to never
/// again show a request for this permission. The user may still change the /// again show a request for this permission. The user may still change the
/// permission status in the settings. /// permission status in the settings.
...@@ -33,9 +34,11 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -33,9 +34,11 @@ extension PermissionStatusValue on PermissionStatus {
return 1; return 1;
case PermissionStatus.restricted: case PermissionStatus.restricted:
return 2; return 2;
case PermissionStatus.undetermined: case PermissionStatus.denied:
return 3; return 3;
case PermissionStatus.permanentlyDenied: case PermissionStatus.permanentlyDenied:
return 5;
case PermissionStatus.limited:
return 4; return 4;
default: default:
throw UnimplementedError(); throw UnimplementedError();
...@@ -47,16 +50,13 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -47,16 +50,13 @@ extension PermissionStatusValue on PermissionStatus {
PermissionStatus.denied, PermissionStatus.denied,
PermissionStatus.granted, PermissionStatus.granted,
PermissionStatus.restricted, PermissionStatus.restricted,
PermissionStatus.undetermined, PermissionStatus.limited,
PermissionStatus.permanentlyDenied, PermissionStatus.permanentlyDenied,
][value]; ][value];
} }
} }
extension PermissionStatusGetters on PermissionStatus { extension PermissionStatusGetters on PermissionStatus {
/// If the permission was never requested before.
bool get isUndetermined => this == PermissionStatus.undetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
bool get isGranted => this == PermissionStatus.granted; bool get isGranted => this == PermissionStatus.granted;
...@@ -74,12 +74,11 @@ extension PermissionStatusGetters on PermissionStatus { ...@@ -74,12 +74,11 @@ extension PermissionStatusGetters on PermissionStatus {
/// permission status in the settings. /// permission status in the settings.
/// *Only supported on Android.* /// *Only supported on Android.*
bool get isPermanentlyDenied => this == PermissionStatus.permanentlyDenied; bool get isPermanentlyDenied => this == PermissionStatus.permanentlyDenied;
bool get isLimited => this == PermissionStatus.limited;
} }
extension FuturePermissionStatusGetters on Future<PermissionStatus> { extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// If the permission was never requested before.
Future<bool> get isUndetermined async => (await this).isUndetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
Future<bool> get isGranted async => (await this).isGranted; Future<bool> get isGranted async => (await this).isGranted;
...@@ -98,4 +97,6 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> { ...@@ -98,4 +97,6 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// *Only supported on Android.* /// *Only supported on Android.*
Future<bool> get isPermanentlyDenied async => Future<bool> get isPermanentlyDenied async =>
(await this).isPermanentlyDenied; (await this).isPermanentlyDenied;
Future<bool> get isLimited async => (await this).isLimited;
} }
...@@ -55,47 +55,53 @@ class Permission { ...@@ -55,47 +55,53 @@ class Permission {
/// Android: Nothing /// Android: Nothing
/// iOS: Photos /// iOS: Photos
/// iOS 14+ read & write access level
static const photos = Permission._(9); static const photos = Permission._(9);
/// Android: Nothing /// Android: Nothing
/// iOS: Photos
/// iOS 14+ read & write access level
static const photosAddOnly = Permission._(10);
/// Android: Nothing
/// iOS: Reminders /// iOS: Reminders
static const reminders = Permission._(10); static const reminders = Permission._(11);
/// Android: Body Sensors /// Android: Body Sensors
/// iOS: CoreMotion /// iOS: CoreMotion
static const sensors = Permission._(11); static const sensors = Permission._(12);
/// Android: Sms /// Android: Sms
/// iOS: Nothing /// iOS: Nothing
static const sms = Permission._(12); static const sms = Permission._(13);
/// Android: Microphone /// Android: Microphone
/// iOS: Speech /// iOS: Speech
static const speech = Permission._(13); static const speech = Permission._(14);
/// Android: External Storage /// Android: External Storage
/// iOS: Access to folders like `Documents` or `Downloads`. Implicitly /// iOS: Access to folders like `Documents` or `Downloads`. Implicitly
/// granted. /// granted.
static const storage = Permission._(14); static const storage = Permission._(15);
/// Android: Ignore Battery Optimizations /// Android: Ignore Battery Optimizations
static const ignoreBatteryOptimizations = Permission._(15); static const ignoreBatteryOptimizations = Permission._(16);
/// Android: Notification /// Android: Notification
/// iOS: Notification /// iOS: Notification
static const notification = Permission._(16); static const notification = Permission._(17);
/// Android: Allows an application to access any geographic locations /// Android: Allows an application to access any geographic locations
/// persisted in the user's shared collection. /// persisted in the user's shared collection.
static const accessMediaLocation = Permission._(17); static const accessMediaLocation = Permission._(18);
/// When running on Android Q and above: Activity Recognition /// When running on Android Q and above: Activity Recognition
/// When running on Android < Q: Nothing /// When running on Android < Q: Nothing
/// iOS: Nothing /// iOS: Nothing
static const activityRecognition = Permission._(18); static const activityRecognition = Permission._(19);
/// The unknown only used for return type, never requested /// The unknown only used for return type, never requested
static const unknown = Permission._(19); static const unknown = Permission._(20);
/// Returns a list of all possible [PermissionGroup] values. /// Returns a list of all possible [PermissionGroup] values.
static const List<Permission> values = <Permission>[ static const List<Permission> values = <Permission>[
...@@ -109,6 +115,7 @@ class Permission { ...@@ -109,6 +115,7 @@ class Permission {
microphone, microphone,
phone, phone,
photos, photos,
photosAddOnly,
reminders, reminders,
sensors, sensors,
sms, sms,
...@@ -132,6 +139,7 @@ class Permission { ...@@ -132,6 +139,7 @@ class Permission {
'microphone', 'microphone',
'phone', 'phone',
'photos', 'photos',
'photosAddOnly',
'reminders', 'reminders',
'sensors', 'sensors',
'sms', 'sms',
......
...@@ -3,20 +3,20 @@ description: A common platform interface for the permission_handler plugin. ...@@ -3,20 +3,20 @@ description: A common platform interface for the permission_handler plugin.
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a # NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.0.1 version: 3.0.0+1
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
meta: ^1.0.5 meta: ^1.0.5
plugin_platform_interface: ^1.0.2 plugin_platform_interface: ^2.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
mockito: ^4.1.1 mockito: ^5.0.0
effective_dart: ^1.2.1 effective_dart: ^1.3.0
environment: environment:
sdk: ">=2.6.0 <3.0.0" sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.9.1+hotfix.4 <2.0.0" flutter: ">=1.22.0"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment