Question

func uploadImg) if usernameField.text nil 58 59 print(must have username) completeSignInBtn.isEnabledfalse else usernameuseI can't figure out the new formatting for Firebase 5.0. Can you help me solve this error that is being thrown?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I think you have updated your firebase pods.

According to Firebase 5.0 they removed function metadata?.downloadURL() . So it wont work.

Try to look at the updated documentation of Firebase5.0 and reformate your code

Im attaching below sample code accord to updated docs

Update your pods and put this instead:


    guard let uid = Auth.auth().currentUser?.uid else { return }
    let storage_ref = Storage.storage().reference().child("user/\(uid)")

    let imageData = UIImageJPEGRepresentation(image, 0.75) else { return }

    let meta_Data = StorageMetadata()
    meta_Data.contentType = "image/jpg"

    storage_ref.putData(imageData, metadata: meta_Data) { meta_Data, error in
        if error == nil, meta_Data != nil {

            storage_ref.downloadURL { url_link, error in
                completion(url_link)
                // success completed!
            }
            } else {
                // failed here
                completion(nil)
            }
        }
    }
Add a comment
Know the answer?
Add Answer to:
I can't figure out the new formatting for Firebase 5.0. Can you help me solve this error that is being thrown? func...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, my name is Shady Slim. I understand you are going to help me figure out...

    Hello, my name is Shady Slim. I understand you are going to help me figure out my gross income for the year... whatever that means. It's been a busy year and I'm a busy man, so let me give you the lowdown on my life and you can do your thing I was unemployed at the beginning of the year and got $2,000 in unemployment compensation. I later got a job as a manager for Roca Cola. I earned $57,500...

  • can you please help me figure out the break even analysis? (last photo ) fx =ROUND(420*(2500/4200),2)...

    can you please help me figure out the break even analysis? (last photo ) fx =ROUND(420*(2500/4200),2) Total Variable Costs 2$ 4.65 Total Fixed Costs 2$ 858.44 Based on 12 dogs per day. Assume 22 eight-hour work days for kennel attendant. BOARDING Item Variable Costs Item Fixed Costs Kennel attendant 2$ 5.62 Depreciation on kennels 2$ 80.00 Bowls 0.86 Rent 386.90 Towels 0.87 Loan 250.00 Utilities and Insurance 357.14 Depreciation on heating system Cleaning Products: Odoban Cleaning Products: Simple Green 49.40...

  • I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I...

    I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I just have to explain a lot so you understand how the program should work. In C programming, write a simple program to take a text file as input and encrypt/decrypt it by reading the text bit by bit, and swap the bits if it is specified by the first line of the text file to do so (will explain below, and please let me...

  • PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create...

    PL/SQL Auction Program 1. Create a user xyz, who is the owner of the auction. Create the schema, and package. 2. Create users x1 and x2 who are the participants in the auction. They will need acces to the package. 3. Bid on the same item and record your observations. Verify all scenarios. Upload the files with the missing code and a detailed sample run. AUCTION OWNER.TXT SQL> conn / as sysdba Connected. SQL> drop user xyz cascade; User dropped....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT