Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* @flow */
import React from 'react';
import { ScreenOrientation } from 'expo';
ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT);
import { View } from 'react-native';
import { StackNavigator } from 'react-navigation';
import StacksInTabs from './src/components/StacksInTab';
class MainScreen extends React.Component<*> {
render() {
return (
);
}
}
lockPlatformExample = async () => {
if (Platform.OS === 'web') {
// most web browsers require fullscreen in order to change screen orientation
await document.documentElement.requestFullscreen();
}
await ScreenOrientation.lockPlatformAsync({
screenOrientationLockWeb: ScreenOrientation.WebOrientationLock.LANDSCAPE,
screenOrientationArrayIOS: [
ScreenOrientation.Orientation.PORTRAIT_DOWN,
ScreenOrientation.Orientation.LANDSCAPE_RIGHT,
],
screenOrientationConstantAndroid: 8, // reverse landscape
}).catch(e => alert(e)); // on iPhoneX PortraitUpsideDown would be rejected
if (Platform.OS === 'web') {
await document.exitFullscreen();
}
}
Permissions.CONTACTS === 'contacts';
Permissions.NOTIFICATIONS === 'remoteNotifications';
Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
async () => {
const result = await Permissions.askAsync(Permissions.CAMERA);
result.status === 'granted';
result.status === 'denied';
result.status === 'undetermined';
result.expires === 'never';
};
ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
class __TestEntry__ extends React.Component {
render() {
return(
);
}
}
registerRootComponent(__TestEntry__);
Permissions.NOTIFICATIONS === 'notifications';
Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness';
Permissions.USER_FACING_NOTIFICATIONS === 'userFacingNotifications';
Permissions.REMINDERS === 'reminders';
async () => {
const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS);
result.status === 'granted';
result.status === 'denied';
result.status === 'undetermined';
result.expires === 'never';
};
ScreenOrientation.Orientation.ALL;
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
class __TestEntry__ extends React.Component {
render() {
return(
);
}
}
registerRootComponent(__TestEntry__);
Calendar.EntityTypes.EVENT === 'event';
Calendar.EntityTypes.REMINDER === 'reminder';
Calendar.CalendarType.LOCAL === 'local';
Calendar.CalendarType.CALDAV === 'caldav';
Calendar.CalendarType.EXCHANGE === 'exchange';
async componentWillMount() {
ThreeAR.suppressWarnings(true);
THREE.suppressExpoWarnings(true);
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL);
}
switchToPortrait() {
ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT);
}
}
componentDidMount () {
ScreenOrientation.allow(ScreenOrientation.Orientation.ALL)
Dimensions.addEventListener(
'change',
this.orientationChangeHandler.bind(this)
)
}
switchToPortrait = () => {
ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT)
}
componentWillUnmount() {
ScreenOrientation.allow(ScreenOrientation.Orientation.PORTRAIT)
Dimensions.removeEventListener('change', this.orientationChangeHandler)
}
componentDidMount() {
ScreenOrientation.allowAsync(ScreenOrientation.Orientation.LANDSCAPE)
}