Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function isAvailable(): boolean {
// Device has A9 chip
const hasA9Chip = Constants.deviceYearClass && Constants.deviceYearClass > 2014;
if (
!Constants.isDevice || // Prevent Simulators
// @ts-ignore
Platform.isTVOS ||
Platform.OS !== 'ios' || // Device is iOS
!hasA9Chip ||
!ExponentAR.isSupported || // ARKit is included in the build
!ExponentAR.startAsync // Older SDK versions (27 and lower) that are fully compatible
) {
return false;
}
return true;
}
export function isAvailable() {
// Device has A9 chip
const hasA9Chip = Constants.deviceYearClass && Constants.deviceYearClass > 2014;
if (!Constants.isDevice || // Prevent Simulators
// @ts-ignore
Platform.isTVOS ||
Platform.OS !== 'ios' || // Device is iOS
!hasA9Chip ||
!ExponentAR.isSupported || // ARKit is included in the build
!ExponentAR.startAsync // Older SDK versions (27 and lower) that are fully compatible
) {
return false;
}
return true;
}
export function getUnavailabilityReason() {
it('should passes when used properly', () => {
(Constants.debugMode: boolean);
(Constants.deviceName: ?string);
(Constants.deviceYearClass: number | null);
(Constants.experienceUrl: string);
(Constants.expoRuntimeVersion: string);
(Constants.expoVersion: string);
(Constants.isDetached: ?boolean);
(Constants.intentUri: ?string);
(Constants.installationId: string);
(Constants.isDevice: boolean);
(Constants.isHeadless: boolean);
(Constants.linkingUri: string);
(Constants.sessionId: string);
(Constants.statusBarHeight: number);
(Constants.systemVersion: ?number);
(Constants.systemFonts: Array);
});
export function getUnavailabilityReason() {
if (!Constants.isDevice) {
return AvailabilityErrorMessages.Simulator;
}
else if (Platform.OS !== 'ios') {
return `${AvailabilityErrorMessages.ARKitOnlyOnIOS} ${Platform.OS} device`;
}
else if (Constants.deviceYearClass == null || Constants.deviceYearClass < 2015) {
return `${AvailabilityErrorMessages.ANineChip} ${Constants.deviceYearClass} device`;
}
return 'Unknown Reason';
}
export function onFrameDidUpdate(listener) {
export function getUnavailabilityReason(): string {
if (!Constants.isDevice) {
return AvailabilityErrorMessages.Simulator;
} else if (Platform.OS !== 'ios') {
return `${AvailabilityErrorMessages.ARKitOnlyOnIOS} ${Platform.OS} device`;
} else if (Constants.deviceYearClass == null || Constants.deviceYearClass < 2015) {
return `${AvailabilityErrorMessages.ANineChip} ${Constants.deviceYearClass} device`;
}
return 'Unknown Reason';
}
public render() {
const navigate = this.props.navigation.navigate;
return (