use of com.google.firebase.storage.FirebaseStorage in project OnlineCanteen by josephgunawan97.
the class AccountUtil method uploadProfilePicture.
private static UploadTask uploadProfilePicture(Uri profilePictureUri) {
FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageReference = storage.getReference();
StorageReference directoryReference = storageReference.child("profilepics");
StorageReference profilePictureReference = directoryReference.child(firebaseUser.getUid() + ".jpg");
if (profilePictureUri != null) {
return profilePictureReference.putFile(profilePictureUri);
} else
return null;
}
Aggregations