Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo in error message #10

Merged
merged 3 commits into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.baseflow.permissionhandler'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.1.51'
ext.kotlin_version = '1.2.51'
repositories {
google()
jcenter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PermissionHandlerPlugin(private val registrar: Registrar, private var requ
call.method == "requestPermissions" -> {
if (mResult != null) {
result.error(
"ERROR_ALREADY_REQUESTED_PERMISSIONS",
"ERROR_ALREADY_REQUESTING_PERMISSIONS",
"A request for permissions is already running, please wait for it to finish before doing another request (note that you can request multiple permissions at the same time).",
null)
}
Expand Down
Binary file removed example/android/.idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 0 additions & 29 deletions example/android/.idea/codeStyles/Project.xml

This file was deleted.

19 changes: 0 additions & 19 deletions example/android/.idea/gradle.xml

This file was deleted.

34 changes: 0 additions & 34 deletions example/android/.idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions example/android/.idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions example/android/.idea/runConfigurations.xml

This file was deleted.

14 changes: 8 additions & 6 deletions ios/Classes/SwiftPermissionHandlerPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ public class SwiftPermissionHandlerPlugin: NSObject, FlutterPlugin {

public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
if call.method == "checkPermissionStatus" {
let permission: PermissionGroup = Codec.decodePermissionGroup(from: call.arguments)

PermissionManager.checkPermissionStatus(
permission: Codec.decodePermissionGroup(
from: call.arguments),
result: result)
permission: permission,
result: result)
} else if call.method == "requestPermissions" {
let permissions: [PermissionGroup] = Codec.decodePermissionGroups(from: call.arguments)

_permissionManager.requestPermission(
permissions: Codec.decodePermissionGroups(
from: call.arguments),
result: result)
permissions: permissions,
result: result)
} else if call.method == "shouldShowRequestPermissionRationale" {
result(false)
} else if call.method == "openAppSettings" {
Expand Down
6 changes: 6 additions & 0 deletions lib/permission_handler.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/services.dart';
import 'package:permission_handler/permission_enums.dart';
Expand Down Expand Up @@ -44,6 +45,11 @@ class PermissionHandler {
/// returns [false].
static Future<bool> shouldShowRequestPermissionRationale(
PermissionGroup permission) async {

if (!Platform.isAndroid) {
return false;
}

final bool shouldShowRationale = await _channel.invokeMethod(
'shouldShowRequestPermissionRationale',
Codec.encodePermissionGroup(permission));
Expand Down