How to use the react-native-permissions.IOS_PERMISSIONS function in react-native-permissions

To help you get started, we’ve selected a few react-native-permissions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-native-community / react-native-permissions / example / App.js View on Github external
import theme from "./theme";

import {
  AppState,
  Platform,
  StatusBar,
  ScrollView,
  StyleSheet,
  Text,
  View,
} from "react-native";

// $FlowFixMe
let platformPermissions: string[] = Object.values(
  Platform.OS === "ios"
    ? RNPermissions.IOS_PERMISSIONS
    : RNPermissions.ANDROID_PERMISSIONS,
).filter(permission => permission !== "SIRI");

const statusColors: { [PermissionStatus]: string } = {
  granted: "#43a047",
  denied: "#ff9800",
  never_ask_again: "#e53935",
  unavailable: "#cfd8dc",
};

const statusIcons: { [PermissionStatus]: string } = {
  granted: "check-circle",
  denied: "error",
  never_ask_again: "cancel",
  unavailable: "lens",
};