Complete the code to import the Camera module from Expo.
import { [1] } from 'expo-camera';
The correct import is Camera from expo-camera. This is the official module name.
Complete the code to request camera permissions using Expo Camera module.
const { status } = await Camera.[1]PermissionsAsync();The method to request permissions is requestPermissionsAsync(). It asks the user for permission.
Fix the error in the code to correctly use the Expo Location module to get current position.
import * as Location from 'expo-location'; const location = await Location.[1]();
The correct method is getCurrentPositionAsync() which returns a Promise with location data.
Fill both blanks to create a button that opens the image picker from Expo.
import * as ImagePicker from 'expo-image-picker'; async function pickImage() { let result = await ImagePicker.[1](); if (!result.[2]) { console.log('User cancelled image picker'); } }
The method to open the image library is launchImageLibraryAsync(). The result has a cancelled property to check if user cancelled.
Fill all three blanks to create a dictionary comprehension that filters permissions with granted status in Expo Permissions module.
import * as Permissions from 'expo-permissions'; const statuses = await Permissions.getAsync(Permissions.CAMERA, Permissions.LOCATION); const grantedPermissions = { [1]: [2] for ([3], [2]) of Object.entries(statuses) if [2].status === 'granted' };
We iterate over Object.entries(statuses) with (perm, status). The dictionary comprehension uses perm as key and status as value, filtering where status.status === 'granted'.