Revert: Ask for microphone permission when launching the app
This partially reverts commit fe2b85ec32
Microphone permission is now only asked on-demand
This commit is contained in:
1 parent
fe2b85ec32
commit
9fb19fa211
1 file changed
+1
-25
@@ -1,4 +1,3 @@
|
||||
#include <AVFoundation/AVAudioSession.h>
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "LauncherNewsViewController.h"
|
||||
#import "LauncherPreferences.h"
|
||||
@@ -40,9 +39,7 @@ UIEdgeInsets insets;
|
||||
[webView.scrollView setShowsHorizontalScrollIndicator:NO];
|
||||
[webView loadRequest:request];
|
||||
[self.view addSubview:webView];
|
||||
|
||||
[self askForMicrophonePermission];
|
||||
|
||||
|
||||
if(roundf(NSProcessInfo.processInfo.physicalMemory / 1048576) < 1900 && ![getPreference(@"force_unsupported_launch") boolValue]) {
|
||||
UIAlertController *RAMAlert = [UIAlertController alertControllerWithTitle:localize(@"login.warn.title.a7", nil) message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction *ok = [UIAlertAction actionWithTitle:localize(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
||||
@@ -108,25 +105,4 @@ decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
decisionHandler(WKNavigationActionPolicyAllow);
|
||||
}
|
||||
|
||||
- (void)askForMicrophonePermission {
|
||||
switch ([[AVAudioSession sharedInstance] recordPermission]) {
|
||||
case AVAudioSessionRecordPermissionGranted:
|
||||
setenv("POJAV_MIC_ALLOWED", "1", 1);
|
||||
break;
|
||||
case AVAudioSessionRecordPermissionDenied:
|
||||
break;
|
||||
case AVAudioSessionRecordPermissionUndetermined:
|
||||
// This is the initial state before a user has made any choice
|
||||
// You can use this spot to request permission here if you want
|
||||
[[AVAudioSession sharedInstance]requestRecordPermission:^(BOOL granted) {
|
||||
if(granted) {
|
||||
setenv("POJAV_MIC_ALLOWED", "1", 1);
|
||||
}
|
||||
}];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user