
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-native-permissions-ui
Advanced tools
A React-native package that facilitates handling device permissions in graceful and customizable way.
A React Native package for creating custom UI screens to request permissions, such as camera access, with a simple and customizable API.
npm install react-native-permissions-ui react-native-permissions
First, ensure you have the necessary setup for React Native Permissions. Follow the setup instructions
Then, you can use the CameraPermissionScreen component and usePermission hook in your project as shown below:
import React from "react";
import { View, StyleSheet } from "react-native";
import {
CameraPermissionScreen,
usePermission,
} from "react-native-permissions-ui";
import { PERMISSIONS } from "react-native-permissions";
const App: React.FC = () => {
const { status, requestPermission } = usePermission(
PERMISSIONS.ANDROID.CAMERA
);
return (
<View style={styles.container}>
<CameraPermissionScreen
title="Camera Permission Required"
description="We need access to your camera to take photos."
buttonText="Grant Permission"
onRequestPermission={requestPermission}
icon={require("./assets/camera.png")}
permissionStatus={status}
/>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
});
export default App;
You can customize the CameraPermissionScreen component by passing styles and an icon:
<CameraPermissionScreen
title="Camera Permission Required"
description="We need access to your camera to take photos."
buttonText="Grant Permission"
onRequestPermission={requestPermission}
icon={require("./assets/camera.png")}
permissionStatus={status}
titleStyle={{ fontSize: 24, color: "blue" }}
descriptionStyle={{ fontSize: 16, color: "gray" }}
buttonStyle={{ backgroundColor: "green" }}
buttonTextStyle={{ color: "white" }}
/>
A component that displays a screen to request camera permission.
| Prop | Type | Description |
|---|---|---|
title | string | The title of the permission request screen. |
description | string | The description of why the permission is needed. |
buttonText | string | The text displayed on the permission request button. |
onRequestPermission | () => void | The function to call when the button is pressed. |
icon | mageSourcePropType | An optional icon to display on the screen. |
titleStyle | TextStyle | Custom styles for the title text. |
onRequestPermission | TextStyle | Custom styles for the button. |
onRequestPermission | ViewStyle | Custom styles for the button. |
onRequestPermission | TextStyle | Custom styles for the button text. |
onRequestPermission | string | null | granted | denied | blocked | unavailable | limited |null |
A custom hook for managing permission status.
| Parameter | Type | Description |
|---|---|---|
permissionType | typeof PERMISSIONS.ANDROID.CAMERA | typeof PERMISSIONS.IOS.CAMERA | The type of permission to check. |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FAQs
A React-native package that facilitates handling device permissions in graceful and customizable way.
We found that react-native-permissions-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.