diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf2a6a..2ac41e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,12 @@ +## 0.4.3 +* fix iOS has permission result issue; + ## 0.4.2 -* fix the android's audio file path, now you can get it from *current* method +* fix the Android's audio file path, now you can get it from *current* method ## 0.4.1 -* Change Android Dependencies Version +* Change Android dependencies version ## 0.4.0 @@ -38,11 +41,11 @@ ## 0.1.2 -* Updated Package Description. +* Updated package description. ## 0.1.1 -* Chinese Documentation added. +* Chinese documentation added. ## 0.1.0 @@ -50,4 +53,4 @@ ## 0.0.1 -* Initial Release. +* Initial release. diff --git a/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift b/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift index 75f553f..24fd0e7 100644 --- a/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift +++ b/ios/Classes/SwiftFlutterAudioRecorderPlugin.swift @@ -137,6 +137,7 @@ public class SwiftFlutterAudioRecorderPlugin: NSObject, FlutterPlugin, AVAudioRe case "resume": print("resume") + if audioRecorder == nil { result(nil) } @@ -160,12 +161,15 @@ public class SwiftFlutterAudioRecorderPlugin: NSObject, FlutterPlugin, AVAudioRe break case AVAudioSession.RecordPermission.undetermined: print("undetermined") + AVAudioSession.sharedInstance().requestRecordPermission() { [unowned self] allowed in DispatchQueue.main.async { if allowed { self.hasPermissions = true + result(self.hasPermissions) } else { self.hasPermissions = false + result(self.hasPermissions) } } } diff --git a/pubspec.yaml b/pubspec.yaml index 9f7a6cb..602a131 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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.2 +version: 0.4.3 authors: - wenyan - tao zhu