fix: only call requestRecordPermission in debug mode (#2119)
This commit is contained in:
parent
06ddd6f7b9
commit
959327e99b
@ -386,16 +386,19 @@ RCT_EXPORT_METHOD(checkVideoAuthorizationStatus:(RCTPromiseResolveBlock)resolve
|
||||
|
||||
RCT_EXPORT_METHOD(checkRecordAudioAuthorizationStatus:(RCTPromiseResolveBlock)resolve
|
||||
reject:(__unused RCTPromiseRejectBlock)reject) {
|
||||
#ifdef DEBUG
|
||||
if ([[NSBundle mainBundle].infoDictionary objectForKey:@"NSMicrophoneUsageDescription"] == nil) {
|
||||
RCTLogWarn(@"Checking audio permissions without having key 'NSMicrophoneUsageDescription' defined in your Info.plist. Audio Recording for your video files is therefore disabled. If you do not need audio on your recordings is is recommended to set the 'captureAudio' property on your component instance to 'false', otherwise you will have to add the key 'NSMicrophoneUsageDescription' to your Info.plist. If you do not your app will crash when being built in release mode. You can learn more about adding permissions here: https://stackoverflow.com/a/38498347/4202031");
|
||||
resolve(@(NO));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
|
||||
resolve(@(granted));
|
||||
}];
|
||||
#else
|
||||
resolve(@(YES));
|
||||
#endif
|
||||
[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {
|
||||
resolve(@(granted));
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
RCT_REMAP_METHOD(getAvailablePictureSizes,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user