Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderSinglePermissionsButtons() {
const permissions: Array<[string, Permissions.PermissionType]> = [
['CAMERA', Permissions.CAMERA],
['AUDIO_RECORDING', Permissions.AUDIO_RECORDING],
['LOCATION', Permissions.LOCATION],
['USER_FACING_NOTIFICATIONS', Permissions.USER_FACING_NOTIFICATIONS],
['NOTIFICATIONS', Permissions.NOTIFICATIONS],
['CONTACTS', Permissions.CONTACTS],
['SYSTEM_BRIGHTNESS', Permissions.SYSTEM_BRIGHTNESS],
['CAMERA_ROLL', Permissions.CAMERA_ROLL],
['CALENDAR', Permissions.CALENDAR],
['REMINDERS', Permissions.REMINDERS],
];
return permissions.map(([permissionName, permissionType]) => (
import * as Permissions from 'expo-permissions'
import React, { useEffect, useState } from 'react'
import { Button, ScrollView, Text, View } from 'react-native'
import Example from '../example'
const permissions = [
['CAMERA', Permissions.CAMERA],
['AUDIO_RECORDING', Permissions.AUDIO_RECORDING],
['LOCATION', Permissions.LOCATION],
['USER_FACING_NOTIFICATIONS', Permissions.USER_FACING_NOTIFICATIONS],
['NOTIFICATIONS', Permissions.NOTIFICATIONS],
['CONTACTS', Permissions.CONTACTS],
['SYSTEM_BRIGHTNESS', Permissions.SYSTEM_BRIGHTNESS],
['CAMERA_ROLL', Permissions.CAMERA_ROLL],
['CALENDAR', Permissions.CALENDAR],
['REMINDERS', Permissions.REMINDERS],
]
export default function PermissionsExample() {
return (
{permissions.map(([permissionName, permissionType]) => (
renderSinglePermissionsButtons() {
const permissions = [
['CAMERA', Permissions.CAMERA],
['AUDIO_RECORDING', Permissions.AUDIO_RECORDING],
['LOCATION', Permissions.LOCATION],
['USER_FACING_NOTIFICATIONS', Permissions.USER_FACING_NOTIFICATIONS],
['NOTIFICATIONS', Permissions.NOTIFICATIONS],
['CONTACTS', Permissions.CONTACTS],
['SYSTEM_BRIGHTNESS', Permissions.SYSTEM_BRIGHTNESS],
['CAMERA_ROLL', Permissions.CAMERA_ROLL],
['CALENDAR', Permissions.CALENDAR],
['REMINDERS', Permissions.REMINDERS],
];
return permissions.map(([permissionName, permissionType]) => (