Skip to content

Commit

Permalink
Replace deprecated requestRecordPermission
Browse files Browse the repository at this point in the history
This method is deprecated from iOS 17 upwards.
  • Loading branch information
matthewrfennell authored and tmolitor-stud-tu committed Sep 3, 2024
1 parent f1ca7c7 commit 2ce574b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Monal/Classes/chatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1201,9 +1201,15 @@ -(IBAction) record:(id) sender
{
dispatch_async(dispatch_get_main_queue(), ^{
DDLogInfo(@"Record button pressed...");
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
[self handleRecord:granted];
}];
if(@available(iOS 17, macCatalyst 17.0, *)) {
[AVAudioApplication requestRecordPermissionWithCompletionHandler:^(BOOL granted) {
[self handleRecord:granted];
}];
} else {
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
[self handleRecord:granted];
}];
}
});
}

Expand Down

0 comments on commit 2ce574b

Please sign in to comment.