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() {
6060 }
6161
6262 @ ReactMethod
63- public void downloadUrl (final String storageUrl ,
63+ public void downloadUrl (final String javascriptStorageBucket ,
6464 final String path ,
6565 final Callback callback ) {
6666 FirebaseStorage storage = FirebaseStorage .getInstance ();
67+ String storageBucket = storage .getApp ().getOptions ().getStorageBucket ();
68+ String storageUrl = "gs://" +storageBucket ;
6769 StorageReference storageRef = storage .getReferenceFromUrl (storageUrl );
68- StorageReference fileRef = storageRef .child (path );
70+ StorageReference fileRef = storageRef .child (path );
6971
70- Task <Uri > downloadTask = storageRef .getDownloadUrl ();
72+ Task <Uri > downloadTask = fileRef .getDownloadUrl ();
7173 downloadTask .addOnSuccessListener (new OnSuccessListener <Uri >() {
7274 @ Override
7375 public void onSuccess (Uri uri ) {
You can’t perform that action at this time.
0 commit comments