Created
July 10, 2020 21:55
-
-
Save brandonsueur/5e29d4e2fddaa27909322faa0cda0f3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const photo = await cameraRef.takePictureAsync({ | |
quality: 0.7, | |
exif: true, | |
base64: true, | |
}); | |
const response = await fetch(photo.uri); | |
const blob = await response.blob(); | |
const ref = storage() | |
.ref() | |
.child("Proofs/" + new Date().getTime()); | |
const snapshot = await ref.put(blob, { | |
contentType: "image/jpeg", | |
}); | |
const photoUrl = await snapshot.ref.getDownloadURL(); | |
// for saved in the collection | |
photoUrl.toString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment