how to utilise firebase asset download method in addressables?

Hello,

I am using Addressable package and Firebase Storage for my Unity Project. Firebase has given below code in their docs to generate downloadURL for assets stored in Firebase Storage.

// Create a reference from a Google Cloud Storage URI
Firebase.Storage.StorageReference reference =
storage.GetReferenceFromUrl(“gs://bucket/images/stars.jpg”);

// Fetch the download URL
reference.GetDownloadUrlAsync().ContinueWith((Task task) => {
if (!task.IsFaulted && !task.IsCanceled) {
Debug.Log("Download URL: " + task.Result());
// … now download the file via WWW or UnityWebRequest.
}
});

So in the case of Adressables, I need to set Remote Load Path as “gs://bucket/images/stars.jpg”. while execution , this will throw an error simply because its not a direct downloadURL.
My question is where and how do I integrate this code in Addressables system?
Thanks in Advance!!

Implement the following method before loading anything:

public static string FirebaseLoadPath;

private void GetDownloadURL()
{
    var fireBaseRef = FirebaseStorage.DefaultInstance.GetReferenceFromUrl("gs://[your google bucket reference]"); 

    fireBaseRef.GetDownloadUrlAsync().ContinueWith((Task<Uri> task) =>
    {
        if (!task.IsFaulted && !task.IsCanceled)
        {                
            FirebaseLoadPath = task.Result.ToString();
        }

    });
}

Then use this as you remote load path {[YourClassName].FirebaseLoadPath}. And make sure you there is a check in place so nothing is loaded before the url is set.