import React from "react" import { View, StyleSheet, AsyncStorage, PermissionsAndroid, Platform, } from "react-native" import { NativeRouter, Route, Link, Switch } from "react-router-native" import MapView from "react-native-maps" import { WorkItem, WorkItemList } from "./WorkItem" import { Activity } from "./Activity" import { Home } from "./Home" import { ARViewer } from "./ARViewer" import { Login, Logout, ProtectedRoute, DefaultRoute } from "./Auth" console.ignoredYellowBox = [ // See https://github.com/facebook/react-native/issues/12981 "Setting a timer", "", ] export const ensurePermissions = ( permissions, rationale, onSuccess, onError ) => { PermissionsAndroid.requestMultiple(permissions, rationale) .then((results) => { if ( !Object.values(results).every( (grant) => grant === PermissionsAndroid.RESULTS.GRANTED ) ) { return Promise.reject() } if (onSuccess) { onSuccess(results) } }) .catch((error) => { if (onError) { onError() } }) } export default class App extends React.Component { render() { return ( } /> ) } } const styles = StyleSheet.create({ container: { width: "100%", height: "100%", }, })