Commit 25e7fdae by Sebastian Roth

Merge branch 'develop' of https://github.com/BaseflowIT/flutter-permission-handler into develop

parents adab51da 929a7dda
github: Baseflow
custom: https://baseflow.com/contact
This diff is collapsed. Click to expand it.
## 5.0.0+hotfix.6
* Solved an issue on iOS where requesting notification permissions always resulted in a "granted" result (see pull-request [#289](https://github.com/Baseflow/flutter-permission-handler/pull/289))
## 5.0.0+hotfix.5
* Remove use of the deprecated pre iOS 8 API causing users compile issues (see issue [#277](https://github.com/Baseflow/flutter-permission-handler/issues/277)).
## 5.0.0+hotfix.4
* Solve issue on Android causing an IllegalStateException ([#267](https://github.com/Baseflow/flutter-permission-handler/issues/267)).
## 5.0.0+hotfix.3
* Includes the changes of 4.4.0+hotfix.4 (which was released to be backwardscompatible).
## 5.0.0+hotfix.2
* Removed some residual usages of the `PermissionStatusUnknown` constants in #ifdef statements that were not found by the compiler.
## 5.0.0+hotfix.1 ## 5.0.0+hotfix.1
* Make sure all enums from `permission_handler_platform_interface: 2.0.0` are exposed through the `permission_handler`. * Make sure all enums from `permission_handler_platform_interface: 2.0.0` are exposed through the `permission_handler`.
...@@ -6,6 +26,14 @@ ...@@ -6,6 +26,14 @@
* **BREAKING**: Implemented more intuitive API exposed by `permission_handler_platform_interface: 2.0.0` ([#230](https://github.com/Baseflow/flutter-permission-handler/issues/230)). * **BREAKING**: Implemented more intuitive API exposed by `permission_handler_platform_interface: 2.0.0` ([#230](https://github.com/Baseflow/flutter-permission-handler/issues/230)).
## 4.4.0+hotfix.4
* Android: solved issue where `permission_handler` is used in a service (see [#251](https://github.com/Baseflow/flutter-permission-handler/issues/251))
## 4.4.0+hotfix.3
IGNORE THIS VERSION, it was released by accident and contains the same code as 4.4.0+hotfix.2
## 4.4.0+hotfix.2 ## 4.4.0+hotfix.2
* Issue #235: Solved a bug which made it impossible to request service status on Android 7; * Issue #235: Solved a bug which made it impossible to request service status on Android 7;
......
...@@ -9,30 +9,33 @@ On Android, you can show a rationale for requesting a permission. ...@@ -9,30 +9,33 @@ On Android, you can show a rationale for requesting a permission.
## Setup ## Setup
While the permissions are being requested during runtime, you'll still need to tell the OS which permissions your app might potentially use. 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.
That requires adding permission configuration to Android- and iOS-specific files.
<details> <details>
<summary>Android</summary> <summary>Android</summary>
**Upgrade pre 1.12 Android projects**
Since version 4.4.0 this plugin is implemented using the Flutter 1.12 Android plugin APIs. Unfortunately this means App developers also need to migrate their Apps to support the new Android infrastructure. You can do so by following the [Upgrading pre 1.12 Android projects](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects) migration guide. Failing to do so might result in unexpected behaviour. Most common known error is the permission_handler not returning after calling the `.request()` method on a permission.
**AndroidX**
> The current version of the plugin requires AndroidX. As of version 3.1.0 the <kbd>permission_handler</kbd> plugin switched to the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility).
>
> As of version 3.1.0 the <kbd>permission_handler</kbd> plugin switched to the AndroidX version of the Android Support Libraries. This means you need to make sure your Android project is also upgraded to support AndroidX. Detailed instructions can be found [here](https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility). The TL;DR version is:
> 1. Add the following to your "gradle.properties" file:
> The TL;DR version is: ```
> 1. Add the following to your "gradle.properties" file: android.useAndroidX=true
> ``` android.enableJetifier=true
> android.useAndroidX=true ```
> android.enableJetifier=true 2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 28:
> ``` ```
> 2. Make sure you set the `compileSdkVersion` in your "android/app/build.gradle" file to 28: android {
> ``` compileSdkVersion 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).
> ```
> 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. 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.
...@@ -45,12 +48,11 @@ In general, it's sufficient to add permission only to the `main` version. ...@@ -45,12 +48,11 @@ In general, it's sufficient to add permission only to the `main` version.
<summary>iOS</summary> <summary>iOS</summary>
Add permission to your `Info.plist` file. Add permission to your `Info.plist` file.
[Here](https://github.com/Baseflow/flutter-permission-handler/blob/develop/example/ios/Runner/Info.plist)'s an example `Info.plist` with a complete list of all possible permissions. [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). > 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/ios/Classes/PermissionHandlerEnums.h) to control whether a permission is supported. 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.
By default, all the permissions listed [here](https://github.com/Baseflow/flutter-permission-handler#list-of-available-permissions) are supported.
You can remove permissions you don't use: You can remove permissions you don't use:
...@@ -62,7 +64,7 @@ You can remove permissions you don't use: ...@@ -62,7 +64,7 @@ You can remove permissions you don't use:
... # Here are some configurations automatically generated by flutter ... # Here are some configurations automatically generated by flutter
# You can remove unused permissions here # You can remove unused permissions here
# for more infomation: https://github.com/BaseflowIT/flutter-permission-handler/blob/develop/ios/Classes/PermissionHandlerEnums.h # 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' # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)', '$(inherited)',
...@@ -105,7 +107,12 @@ You can remove permissions you don't use: ...@@ -105,7 +107,12 @@ You can remove permissions you don't use:
end end
end end
``` ```
2. Delete the corresponding permission description in `Info.plist` 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' 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`: The following lists the relationship between `Permission` and `The key of Info.plist`:
| Permission | Info.plist | Macro | | Permission | Info.plist | Macro |
...@@ -121,7 +128,7 @@ You can remove permissions you don't use: ...@@ -121,7 +128,7 @@ You can remove permissions you don't use:
| PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS | | PermissionGroup.notification | PermissionGroupNotification | PERMISSION_NOTIFICATIONS |
| PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY | | PermissionGroup.mediaLibrary | NSAppleMusicUsageDescription, kTCCServiceMediaLibrary | PERMISSION_MEDIA_LIBRARY |
| PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS | | PermissionGroup.sensors | NSMotionUsageDescription | PERMISSION_SENSORS |
3. Clean & Rebuild 4. Clean & Rebuild
</details> </details>
...@@ -129,7 +136,7 @@ You can remove permissions you don't use: ...@@ -129,7 +136,7 @@ You can remove permissions you don't use:
## How to use ## How to use
There are a number of [`Permission`](https://pub.dev/documentation/permission_handler_platform_interface/latest/permission_handler_platform_interface/PermissionGroup-class.html)s. 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`. You can get a `Permission`'s `status`, which is either `undetermined`, `granted`, `denied`, `restricted` or `permanentlyDenied`.
```dart ```dart
......
...@@ -5,6 +5,7 @@ import android.content.Context; ...@@ -5,6 +5,7 @@ import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel;
...@@ -16,38 +17,45 @@ import java.util.List; ...@@ -16,38 +17,45 @@ import java.util.List;
final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler { final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler {
private final Context applicationContext; private final Context applicationContext;
private final Activity activity;
private final AppSettingsManager appSettingsManager; private final AppSettingsManager appSettingsManager;
private final PermissionManager permissionManager; private final PermissionManager permissionManager;
private final ServiceManager serviceManager; private final ServiceManager serviceManager;
private final ActivityRegistry activityRegistry;
private final PermissionRegistry permissionRegistry;
private final MethodChannel methodChannel;
MethodCallHandlerImpl( MethodCallHandlerImpl(
Context applicationContext, Context applicationContext,
Activity activity,
BinaryMessenger messenger,
AppSettingsManager appSettingsManager, AppSettingsManager appSettingsManager,
PermissionManager permissionManager, PermissionManager permissionManager,
ServiceManager serviceManager, ServiceManager serviceManager) {
ActivityRegistry activityRegistry,
PermissionRegistry permissionRegistry) {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
this.activity = activity;
this.appSettingsManager = appSettingsManager; this.appSettingsManager = appSettingsManager;
this.permissionManager = permissionManager; this.permissionManager = permissionManager;
this.serviceManager = serviceManager; this.serviceManager = serviceManager;
this.activityRegistry = activityRegistry; }
this.permissionRegistry = permissionRegistry;
@Nullable
private Activity activity;
@Nullable
private ActivityRegistry activityRegistry;
@Nullable
private PermissionRegistry permissionRegistry;
public void setActivity(@Nullable Activity activity) {
this.activity = activity;
}
public void setActivityRegistry(
@Nullable ActivityRegistry activityRegistry) {
this.activityRegistry = activityRegistry;
}
methodChannel = new MethodChannel( public void setPermissionRegistry(
messenger, @Nullable PermissionRegistry permissionRegistry) {
"flutter.baseflow.com/permissions/methods"); this.permissionRegistry = permissionRegistry;
methodChannel.setMethodCallHandler(this);
} }
@Override @Override
public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result)
{ {
switch (call.method) { switch (call.method) {
...@@ -120,8 +128,4 @@ final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler { ...@@ -120,8 +128,4 @@ final class MethodCallHandlerImpl implements MethodChannel.MethodCallHandler {
break; break;
} }
} }
void stopListening() {
methodChannel.setMethodCallHandler(null);
}
} }
...@@ -2,19 +2,16 @@ package com.baseflow.permissionhandler; ...@@ -2,19 +2,16 @@ package com.baseflow.permissionhandler;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.baseflow.permissionhandler.PermissionManager.ActivityRegistry;
import com.baseflow.permissionhandler.PermissionManager.PermissionRegistry;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityAware;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugin.common.PluginRegistry.Registrar;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import com.baseflow.permissionhandler.PermissionManager.ActivityRegistry;
import com.baseflow.permissionhandler.PermissionManager.PermissionRegistry;
/** /**
* Platform implementation of the permission_handler Flutter plugin. * Platform implementation of the permission_handler Flutter plugin.
...@@ -26,8 +23,11 @@ import com.baseflow.permissionhandler.PermissionManager.PermissionRegistry; ...@@ -26,8 +23,11 @@ import com.baseflow.permissionhandler.PermissionManager.PermissionRegistry;
* stable {@code io.flutter.plugin.common} package. * stable {@code io.flutter.plugin.common} package.
*/ */
public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAware { public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAware {
private @Nullable FlutterPluginBinding flutterPluginBinding;
private @Nullable MethodCallHandlerImpl methodCallHandler; private MethodChannel methodChannel;
@Nullable
private MethodCallHandlerImpl methodCallHandler;
/** /**
* Registers a plugin implementation that uses the stable {@code io.flutter.plugin.common} * Registers a plugin implementation that uses the stable {@code io.flutter.plugin.common}
...@@ -37,43 +37,38 @@ public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAwa ...@@ -37,43 +37,38 @@ public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAwa
* won't react to changes in activity or context, unlike {@link PermissionHandlerPlugin}. * won't react to changes in activity or context, unlike {@link PermissionHandlerPlugin}.
*/ */
public static void registerWith(Registrar registrar) { public static void registerWith(Registrar registrar) {
final PermissionHandlerPlugin permissionHandlerPlugin = new PermissionHandlerPlugin(); final PermissionHandlerPlugin plugin = new PermissionHandlerPlugin();
permissionHandlerPlugin.startListening( plugin.startListening(registrar.context(), registrar.messenger());
registrar.context(),
if (registrar.activeContext() instanceof Activity) {
plugin.startListeningToActivity(
registrar.activity(), registrar.activity(),
registrar.messenger(),
registrar::addActivityResultListener, registrar::addActivityResultListener,
registrar::addRequestPermissionsResultListener registrar::addRequestPermissionsResultListener
); );
}
} }
@Override @Override
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
this.flutterPluginBinding = binding; startListening(
binding.getApplicationContext(),
binding.getBinaryMessenger()
);
} }
@Override @Override
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
this.flutterPluginBinding = null; stopListening();
} }
@Override @Override
public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) {
if(flutterPluginBinding == null) { startListeningToActivity(
return; binding.getActivity(),
} binding::addActivityResultListener,
binding::addRequestPermissionsResultListener
startListening( );
flutterPluginBinding.getApplicationContext(),
binding.getActivity(),
flutterPluginBinding.getBinaryMessenger(),
binding::addActivityResultListener,
binding::addRequestPermissionsResultListener);
}
@Override
public void onDetachedFromActivityForConfigChanges() {
onDetachedFromActivity();
} }
@Override @Override
...@@ -83,28 +78,53 @@ public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAwa ...@@ -83,28 +78,53 @@ public final class PermissionHandlerPlugin implements FlutterPlugin, ActivityAwa
@Override @Override
public void onDetachedFromActivity() { public void onDetachedFromActivity() {
if (methodCallHandler == null) { stopListeningToActivity();
return; }
}
@Override
public void onDetachedFromActivityForConfigChanges() {
onDetachedFromActivity();
}
methodCallHandler.stopListening();
private void startListening(Context applicationContext, BinaryMessenger messenger) {
methodChannel = new MethodChannel(
messenger,
"flutter.baseflow.com/permissions/methods");
methodCallHandler = new MethodCallHandlerImpl(
applicationContext,
new AppSettingsManager(),
new PermissionManager(),
new ServiceManager()
);
methodChannel.setMethodCallHandler(methodCallHandler);
}
private void stopListening() {
methodChannel.setMethodCallHandler(null);
methodChannel = null;
methodCallHandler = null; methodCallHandler = null;
} }
private void startListening( private void startListeningToActivity(
Context applicationContext, Activity activity,
Activity activity, ActivityRegistry activityRegistry,
BinaryMessenger messenger, PermissionRegistry permissionRegistry
ActivityRegistry activityRegistry, ) {
PermissionRegistry permissionRegistry) { if (methodCallHandler != null) {
methodCallHandler = new MethodCallHandlerImpl( methodCallHandler.setActivity(activity);
applicationContext, methodCallHandler.setActivityRegistry(activityRegistry);
activity, methodCallHandler.setPermissionRegistry(permissionRegistry);
messenger, }
new AppSettingsManager(), }
new PermissionManager(),
new ServiceManager(), private void stopListeningToActivity() {
activityRegistry, if (methodCallHandler != null) {
permissionRegistry); methodCallHandler.setActivity(null);
methodCallHandler.setActivityRegistry(null);
methodCallHandler.setPermissionRegistry(null);
}
} }
} }
...@@ -36,11 +36,12 @@ final class ServiceManager { ...@@ -36,11 +36,12 @@ final class ServiceManager {
if (permission == PermissionConstants.PERMISSION_GROUP_LOCATION || if (permission == PermissionConstants.PERMISSION_GROUP_LOCATION ||
permission == PermissionConstants.PERMISSION_GROUP_LOCATION_ALWAYS || permission == PermissionConstants.PERMISSION_GROUP_LOCATION_ALWAYS ||
permission == PermissionConstants.PERMISSION_GROUP_LOCATION_WHEN_IN_USE) { permission == PermissionConstants.PERMISSION_GROUP_LOCATION_WHEN_IN_USE) {
final int serviceStatus = isLocationServiceEnabled(context) final int serviceStatus = isLocationServiceEnabled(context)
? PermissionConstants.SERVICE_STATUS_ENABLED ? PermissionConstants.SERVICE_STATUS_ENABLED
: PermissionConstants.SERVICE_STATUS_DISABLED; : PermissionConstants.SERVICE_STATUS_DISABLED;
successCallback.onSuccess(serviceStatus); successCallback.onSuccess(serviceStatus);
return;
} }
if (permission == PermissionConstants.PERMISSION_GROUP_PHONE) { if (permission == PermissionConstants.PERMISSION_GROUP_PHONE) {
......
<?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>BuildSystemType</key>
<string>Latest</string>
</dict>
</plist>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<key>NSLocationUsageDescription</key> <key>NSLocationUsageDescription</key>
<string>Older devices need location.</string> <string>Older devices need location.</string>
<key>NSLocationAlwaysUsageDescription</key> <key>NSLocationAlwaysUsageDescription</key>
<string>Can I haz location always?</string> <string>Can I have location always?</string>
<!-- Permission options for the `mediaLibrary` group --> <!-- Permission options for the `mediaLibrary` group -->
<key>NSAppleMusicUsageDescription</key> <key>NSAppleMusicUsageDescription</key>
......
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
completionHandler(PermissionStatusDenied); completionHandler(PermissionStatusDenied);
return; return;
} }
[[UIApplication sharedApplication] registerForRemoteNotifications];
completionHandler(PermissionStatusGranted);
}]; }];
} else { } else {
UIUserNotificationType notificationTypes = 0; UIUserNotificationType notificationTypes = 0;
notificationTypes |= UIUserNotificationTypeSound; notificationTypes |= UIUserNotificationTypeSound;
...@@ -45,9 +49,10 @@ ...@@ -45,9 +49,10 @@
notificationTypes |= UIUserNotificationTypeBadge; notificationTypes |= UIUserNotificationTypeBadge;
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
completionHandler(PermissionStatusGranted);
} }
[[UIApplication sharedApplication] registerForRemoteNotifications];
completionHandler(PermissionStatusGranted);
}); });
} }
...@@ -68,8 +73,7 @@ ...@@ -68,8 +73,7 @@
UIUserNotificationSettings * setting = [[UIApplication sharedApplication] currentUserNotificationSettings]; UIUserNotificationSettings * setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
if (setting.types == UIUserNotificationTypeNone) permissionStatus = PermissionStatusDenied; if (setting.types == UIUserNotificationTypeNone) permissionStatus = PermissionStatusDenied;
} else { } else {
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; permissionStatus = PermissionStatusDenied;
if (type == UIUserNotificationTypeNone) permissionStatus = PermissionStatusDenied;
} }
return permissionStatus; return permissionStatus;
} }
......
...@@ -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.0+hotfix.1' s.version = '5.0.0+hotfix.6'
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.
......
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.0+hotfix.1 version: 5.0.0+hotfix.6
homepage: https://github.com/baseflowit/flutter-permission-handler homepage: https://github.com/baseflowit/flutter-permission-handler
flutter: flutter:
......
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