Firebase Storage “retrieves a long lived download URL” using getDownloadUrl() now deprecated

后端 未结 3 406
清酒与你
清酒与你 2020-12-06 08:32

This getDownloadUrl() method showed deprecated after updating to

\'com.google.firebase:firebase-storage:15.0.2\'

3条回答
  •  天命终不由人
    2020-12-06 09:25

    In the docs it says this:

    The getDownloadUrl() and getDownloadUrls() methods of the StorageMetadata class are now deprecated. Use getDownloadUrl() from StorageReference instead.

    So you need to use getDownloadUrl() that is inside the StorageReference

    public Task getDownloadUrl ()

    Asynchronously retrieves a long lived download URL with a revokable token. This can be used to share the file with others, but can be revoked by a developer in the Firebase Console if desired.

    more information here:

    https://firebase.google.com/docs/reference/android/com/google/firebase/storage/StorageReference#getDownloadUrl()

提交回复
热议问题