File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
android/src/main/java/io/fullstack/firestack Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,16 @@ public String getName() {
60
60
}
61
61
62
62
@ ReactMethod
63
- public void downloadUrl (final String storageUrl ,
63
+ public void downloadUrl (final String javascriptStorageBucket ,
64
64
final String path ,
65
65
final Callback callback ) {
66
66
FirebaseStorage storage = FirebaseStorage .getInstance ();
67
+ String storageBucket = storage .getApp ().getOptions ().getStorageBucket ();
68
+ String storageUrl = "gs://" +storageBucket ;
67
69
StorageReference storageRef = storage .getReferenceFromUrl (storageUrl );
68
- StorageReference fileRef = storageRef .child (path );
70
+ StorageReference fileRef = storageRef .child (path );
69
71
70
- Task <Uri > downloadTask = storageRef .getDownloadUrl ();
72
+ Task <Uri > downloadTask = fileRef .getDownloadUrl ();
71
73
downloadTask .addOnSuccessListener (new OnSuccessListener <Uri >() {
72
74
@ Override
73
75
public void onSuccess (Uri uri ) {
You can’t perform that action at this time.
0 commit comments