Open MuhammadBilal164 opened 6 months ago
I think you'd have to open an issue or contribute a change in the react-native-permissions
repo to support macOS. I'm not sure how easy or simple that task would be
@Saadnajmi i have created native method which takes permission of camera and microphone and export that method to JS and call that method from JS
create a method in native Module `- (void)requestForCameraAndMicrophonePermission { [AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) { if (granted) { ..... Your logic/ send event to JS } else { ..... Your logic/ send event to JS } }];
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
if (granted) {
..... Your logic/ send event to JS
} else {
..... Your logic/ send event to JS
}
}];
}`
You can also export this method directly but i call this method separately
RCT_EXPORT_METHOD(requestForPermission){ [self requestCameraAndMicrophonePermission]; }
@MuhammadBilal164 is that the same code as iOS, implying that most of the permission requesting code is cross platform between iOS and macOS? If so, it might be easy to add macOS support to react-native-permissions
i want to implement call functionality in macOS and i want mircrophone permission, but in app i am using react-native-permissions which is not available for macOS platform