Skip to content

Commit

Permalink
fix ios hasPermission issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nikk.li committed Oct 18, 2019
1 parent 17224f7 commit 6fd7fa3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 0.4.4
* fix another issue of iOS hasPermission;

## 0.4.3
* fix iOS has permission result issue;
* fix iOS hasPermission result issue;

## 0.4.2
* fix the Android's audio file path, now you can get it from *current* method
Expand Down
6 changes: 5 additions & 1 deletion ios/Classes/SwiftFlutterAudioRecorderPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,12 @@ public class SwiftFlutterAudioRecorderPlugin: NSObject, FlutterPlugin, AVAudioRe
case AVAudioSession.RecordPermission.granted:
print("granted")
hasPermissions = true
result(hasPermissions)
break
case AVAudioSession.RecordPermission.denied:
print("denied")
hasPermissions = false
result(hasPermissions)
break
case AVAudioSession.RecordPermission.undetermined:
print("undetermined")
Expand All @@ -166,18 +168,20 @@ public class SwiftFlutterAudioRecorderPlugin: NSObject, FlutterPlugin, AVAudioRe
DispatchQueue.main.async {
if allowed {
self.hasPermissions = true
print("undetermined true")
result(self.hasPermissions)
} else {
self.hasPermissions = false
print("undetermined false")
result(self.hasPermissions)
}
}
}
break
default:
result(hasPermissions)
break
}
result(hasPermissions)
default:
result(FlutterMethodNotImplemented)
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_audio_recorder
description: Flutter Audio Record Plugin that supports Record Pause Resume Stop and provide access to audio level metering properties average power peak power.
version: 0.4.3
version: 0.4.4
authors:
- wenyan <[email protected]>
- tao zhu <[email protected]>
Expand Down

0 comments on commit 6fd7fa3

Please sign in to comment.