Skip to content

Instantly share code, notes, and snippets.

@brandonsueur
Created July 10, 2020 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonsueur/5e29d4e2fddaa27909322faa0cda0f3d to your computer and use it in GitHub Desktop.
Save brandonsueur/5e29d4e2fddaa27909322faa0cda0f3d to your computer and use it in GitHub Desktop.
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