Skip to content

Commit f42e767

Browse files
committed
Release version 5.1.0
2 parents 31d3551 + fd54bad commit f42e767

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+712
-341
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ android {
4040
Add permissions to your `AndroidManifest.xml` file.
4141
There's a `debug`, `main` and `profile` version which are chosen depending on how you start your app.
4242
In general, it's sufficient to add permission only to the `main` version.
43-
[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.
43+
[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.
4444

4545
</details>
4646

@@ -199,7 +199,7 @@ Please file any issues, bugs or feature request as an issue on our [GitHub](http
199199

200200
## Want to contribute
201201

202-
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).
202+
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).
203203

204204
## Author
205205

permission_handler/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 5.1.0
2+
3+
* Added support for the limited photos permission available on iOS 14 and up;
4+
* Fixed deprecated warning on iOS;
5+
* Added support for the "READ_PHONE_NUMBERS" permission on Android;
6+
* Fix a link to the contribution guide in the README.md.
7+
18
# 5.0.1+1
29

310
* Fixes Typo

permission_handler/android/src/main/java/com/baseflow/permissionhandler/PermissionConstants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,17 @@ final class PermissionConstants {
6363
static final int PERMISSION_STATUS_GRANTED = 1;
6464
static final int PERMISSION_STATUS_RESTRICTED = 2;
6565
static final int PERMISSION_STATUS_NOT_DETERMINED = 3;
66-
static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 4;
66+
static final int PERMISSION_STATUS_LIMITED = 4;
67+
static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 5;
6768

6869
@Retention(RetentionPolicy.SOURCE)
6970
@IntDef({
7071
PERMISSION_STATUS_DENIED,
7172
PERMISSION_STATUS_GRANTED,
7273
PERMISSION_STATUS_RESTRICTED,
7374
PERMISSION_STATUS_NOT_DETERMINED,
74-
PERMISSION_STATUS_NEVER_ASK_AGAIN,
75+
PERMISSION_STATUS_LIMITED,
76+
PERMISSION_STATUS_NEVER_ASK_AGAIN,
7577
})
7678
@interface PermissionStatus {
7779
}

permission_handler/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static int parseManifestName(String permission) {
3838
case Manifest.permission.RECORD_AUDIO:
3939
return PermissionConstants.PERMISSION_GROUP_MICROPHONE;
4040
case Manifest.permission.READ_PHONE_STATE:
41+
case Manifest.permission.READ_PHONE_NUMBERS:
4142
case Manifest.permission.CALL_PHONE:
4243
case Manifest.permission.READ_CALL_LOG:
4344
case Manifest.permission.WRITE_CALL_LOG:
@@ -118,6 +119,10 @@ static List<String> getManifestNames(Context context, @PermissionConstants.Permi
118119
if (hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_STATE))
119120
permissionNames.add(Manifest.permission.READ_PHONE_STATE);
120121

122+
if (android.os.Build.VERSION.SDK_INT > Build.VERSION_CODES.Q && hasPermissionInManifest(context, permissionNames, Manifest.permission.READ_PHONE_NUMBERS)) {
123+
permissionNames.add(Manifest.permission.READ_PHONE_NUMBERS);
124+
}
125+
121126
if (hasPermissionInManifest(context, permissionNames, Manifest.permission.CALL_PHONE))
122127
permissionNames.add(Manifest.permission.CALL_PHONE);
123128

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
6+
/local.properties
7+
GeneratedPluginRegistrant.java
8+
9+
# Remember to never publicly share your keystore.
10+
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11+
key.properties
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example.example">
3+
<!-- Flutter needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.example.example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity: FlutterActivity() {
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Modify this file to customize your launch splash screen -->
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:drawable="?android:colorBackground" />
5+
6+
<!-- You can insert your own image assets here -->
7+
<!-- <item>
8+
<bitmap
9+
android:gravity="center"
10+
android:src="@mipmap/launch_image" />
11+
</item> -->
12+
</layer-list>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<!-- Show a splash screen on the activity. Automatically removed when
6+
Flutter draws its first frame -->
7+
<item name="android:windowBackground">@drawable/launch_background</item>
8+
</style>
9+
<!-- Theme applied to the Android Window as soon as the process has started.
10+
This theme determines the color of the Android Window while your
11+
Flutter UI initializes, as well as behind your Flutter UI while its
12+
running.
13+
14+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16+
<item name="android:windowBackground">?android:colorBackground</item>
17+
</style>
18+
</resources>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*.mode1v3
2+
*.mode2v3
3+
*.moved-aside
4+
*.pbxuser
5+
*.perspectivev3
6+
**/*sync/
7+
.sconsign.dblite
8+
.tags*
9+
**/.vagrant/
10+
**/DerivedData/
11+
Icon?
12+
**/Pods/
13+
**/.symlinks/
14+
profile
15+
xcuserdata
16+
**/.generated/
17+
Flutter/App.framework
18+
Flutter/Flutter.framework
19+
Flutter/Flutter.podspec
20+
Flutter/Generated.xcconfig
21+
Flutter/app.flx
22+
Flutter/app.zip
23+
Flutter/flutter_assets/
24+
Flutter/flutter_export_environment.sh
25+
ServiceDefinitions.json
26+
Runner/GeneratedPluginRegistrant.*
27+
28+
# Exceptions to above rules.
29+
!default.mode1v3
30+
!default.mode2v3
31+
!default.pbxuser
32+
!default.perspectivev3
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#
22
# NOTE: This podspec is NOT to be published. It is only used as a local source!
3+
# This is a generated file; do not edit or check into version control.
34
#
45

56
Pod::Spec.new do |s|
67
s.name = 'Flutter'
78
s.version = '1.0.0'
89
s.summary = 'High-performance, high-fidelity mobile apps.'
9-
s.description = <<-DESC
10-
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
11-
DESC
1210
s.homepage = 'https://flutter.io'
1311
s.license = { :type => 'MIT' }
1412
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
1513
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
1614
s.ios.deployment_target = '8.0'
17-
s.vendored_frameworks = 'Flutter.framework'
15+
# Framework linking is handled by Flutter tooling, not CocoaPods.
16+
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
17+
s.vendored_frameworks = 'path/to/nothing'
1818
end

permission_handler/example/ios/Podfile

Lines changed: 16 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,75 +10,32 @@ project 'Runner', {
1010
'Release' => :release,
1111
}
1212

13-
def parse_KV_file(file, separator='=')
14-
file_abs_path = File.expand_path(file)
15-
if !File.exists? file_abs_path
16-
return [];
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
1717
end
18-
generated_key_values = {}
19-
skip_line_start_symbols = ["#", "/"]
20-
File.foreach(file_abs_path) do |line|
21-
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22-
plugin = line.split(pattern=separator)
23-
if plugin.length == 2
24-
podname = plugin[0].strip()
25-
path = plugin[1].strip()
26-
podpath = File.expand_path("#{path}", file_abs_path)
27-
generated_key_values[podname] = podpath
28-
else
29-
puts "Invalid plugin specification: #{line}"
30-
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
3122
end
32-
generated_key_values
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
3324
end
3425

35-
target 'Runner' do
36-
# Flutter Pod
37-
38-
copied_flutter_dir = File.join(__dir__, 'Flutter')
39-
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
40-
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
41-
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
42-
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
43-
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
44-
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
45-
46-
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
47-
unless File.exist?(generated_xcode_build_settings_path)
48-
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
49-
end
50-
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
51-
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
5227

53-
unless File.exist?(copied_framework_path)
54-
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
55-
end
56-
unless File.exist?(copied_podspec_path)
57-
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
58-
end
59-
end
60-
61-
# Keep pod path relative so it can be checked into Podfile.lock.
62-
pod 'Flutter', :path => 'Flutter'
28+
flutter_ios_podfile_setup
6329

64-
# Plugin Pods
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
6533

66-
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
67-
# referring to absolute paths on developers' machines.
68-
system('rm -rf .symlinks')
69-
system('mkdir -p .symlinks/plugins')
70-
plugin_pods = parse_KV_file('../.flutter-plugins')
71-
plugin_pods.each do |name, path|
72-
symlink = File.join('.symlinks', 'plugins', name)
73-
File.symlink(path, symlink)
74-
pod name, :path => File.join(symlink, 'ios')
75-
end
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
7635
end
7736

7837
post_install do |installer|
7938
installer.pods_project.targets.each do |target|
80-
target.build_configurations.each do |config|
81-
config.build_settings['ENABLE_BITCODE'] = 'NO'
82-
end
39+
flutter_additional_ios_build_settings(target)
8340
end
8441
end

0 commit comments

Comments
 (0)