Comments (3)
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
from react-native-macos.
@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]; }
from react-native-macos.
@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
from react-native-macos.
Related Issues (20)
- [Fabric] TextInput UI is not updated when changing prop `value` or calling `inputRef.current.clear()` / `inputRef.current.setNativeProps({text: ''})` HOT 2
- Web inspector flashing on production/release build when starting the app HOT 6
- Keyboard shortcuts (copy, paste, select) not working in TextInput HOT 6
- "Fatal error: 'ExpoModulesCore/ExpoModulesCore.h' file not found" in run-macos HOT 3
- I want to request a feature like in-app Purchases support, and Firebase support. HOT 3
- useWindowDimensions causes infinite re-rendering HOT 3
- Wrong image pixel density version on initial launch HOT 6
- Right click context menu HOT 5
- No version of react-native-macos@^0.70.0-0 found! HOT 1
- <Text onBlur={() => {}}> throws -[RCTTextView setOnBlur:]: unrecognized selector sent HOT 1
- ERROR: No bundle URL present. HOT 10
- `Text` elements' `backgroundColor` style prop extends to the entire background
- NSTabView doesn't send mouseUp event because it doesn't inherit from NSControl HOT 7
- How can I make the react-native-macos work with ios? HOT 7
- npx react-native run-macos in a new project is launching code in an unrelated project HOT 2
- Native local notifications in macOS (is this already possible?) HOT 19
- React Native Macos overrides `resolveRequest` property of `resolver` in Metro config HOT 2
- Cursor jumps on multiline text inputs HOT 2
- Dimensions.get('window') and useWindowDimensions() return 0 when the containing window is an NSPopover HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-macos.