import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, TouchableOpacity, AlertIOS } from 'react-native'; import {CameraKitCamera, CameraKitGallery} from '../src'; import CameraScreen from './src/CameraScreen'; import AlbumsScreen from './src/AlbumsScreen'; import GalleryScreen from './src/GalleryScreen'; import BarcodeScreen from './src/BarcodeScreen'; class example extends Component { constructor(props) { super(props); this.state = { example: undefined }; } render() { if (this.state.example) { const Example = this.state.example; return ; } return ( Welcome to Camera Kit 📷 this.setState({ example: BarcodeScreen })}> Barcode scanner Screen this.setState({ example: CameraScreen })}> Camera Screen this.setState({ example: AlbumsScreen })}> Albums Screen this.setState({ example: GalleryScreen })}> Gallery Screen this.onCheckCameraAuthoPressed()}> Camera Autotization Status this.onCheckGalleryAuthoPressed()}> Photos Autotization Status ); } async onCheckCameraAuthoPressed() { const success = await CameraKitCamera.checkDeviceCameraAuthorizationStatus(); if (success) { AlertIOS.alert('You have permission 🤗') } else { AlertIOS.alert('No permission 😳') } } async onCheckGalleryAuthoPressed() { const success = await CameraKitGallery.checkDevicePhotosAuthorizationStatus(); if (success) { AlertIOS.alert('You have permission 🤗') } else { AlertIOS.alert('No permission 😳') } } } const styles = StyleSheet.create({ container: { flex: 1, // justifyContent: 'center', paddingTop: 60, alignItems: 'center', backgroundColor: '#F5FCFF', }, headerContainer: { flexDirection: 'column', backgroundColor: '#F5FCFF', justifyContent: 'center', alignItems: 'center', paddingTop: 100 }, headerText: { color: 'black', fontSize: 24 }, buttonText: { color: 'blue', marginBottom: 20, fontSize: 20 } }); AppRegistry.registerComponent('CameraKit', () => example);