|
@@ -1,13 +1,14 @@
|
|
-import * as Expo from 'expo'
|
|
|
|
|
|
+import * as Permissions from 'expo-permissions'
|
|
|
|
+import * as ImagePicker from 'expo-image-picker'
|
|
|
|
|
|
function takePictureWithExpo (options) {
|
|
function takePictureWithExpo (options) {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
- return Expo.Permissions.askAsync(Expo.Permissions.CAMERA).then((isAllowed) => {
|
|
|
|
|
|
+ return Permissions.askAsync(Permissions.CAMERA).then((isAllowed) => {
|
|
if (!isAllowed) {
|
|
if (!isAllowed) {
|
|
return reject(new Error('Permissions denied'))
|
|
return reject(new Error('Permissions denied'))
|
|
}
|
|
}
|
|
|
|
|
|
- return Expo.ImagePicker.launchCameraAsync({ allowsEditing: true })
|
|
|
|
|
|
+ return ImagePicker.launchCameraAsync({ allowsEditing: true })
|
|
.then((result) => {
|
|
.then((result) => {
|
|
if (!result.cancelled) {
|
|
if (!result.cancelled) {
|
|
return resolve(result)
|
|
return resolve(result)
|