Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

swift - Firebase Storage downloadURL()' is deprecated: Use `StorageReference.downloadURLWithCompletion()

Normally I am updating image with url to firebase storage with:

Storage.storage().reference().child("profile_images").child(fileName).putData(uploadData, metadata: nil) {
    [weak self] (metadata, err) in
    guard let strongSelf = self else {
        return
    }

    if let err = err {
        print(err)
    }

    guard let profileImageUrl = metadata?.downloadURL()?.absoluteString else {
        return
    }

    ProfilePhotoHandler.Instance.addPhotoUrl(withUrl: profileImageUrl)
}

But right now Xcode 9.3 show warning:

downloadURL()' is deprecated: Use `StorageReference.downloadURLWithCompletion()

Firebase docs still shows old way. Does anyone can help me how to handle it now?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...