Last active
April 17, 2019 05:49
-
-
Save jirawatee/cb25be320aa3440f54f5a8287a1451aa to your computer and use it in GitHub Desktop.
Firebase Storage - Update file metadata
This file contains hidden or 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
| private void updateMetaData() { | |
| Helper.showDialog(this); | |
| StorageMetadata metadata = new StorageMetadata.Builder().setCustomMetadata("country", "Thailand").build(); | |
| imageRef.updateMetadata(metadata).addOnSuccessListener(new OnSuccessListener<StorageMetadata>() { | |
| @Override | |
| public void onSuccess(StorageMetadata storageMetadata) { | |
| Helper.dismissDialog(); | |
| mTextView.setText(String.format("Country: %s", storageMetadata.getCustomMetadata("country"))); | |
| } | |
| }).addOnFailureListener(new OnFailureListener() { | |
| @Override | |
| public void onFailure(@NonNull Exception exception) { | |
| Helper.dismissDialog(); | |
| mTextView.setText(String.format("Failure: %s", exception.getMessage())); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment