Saving User Profiles to the Database & Uploading Files to Storage - Swift & Firebase Part 2

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024

ความคิดเห็น • 54

  • @kaushaltopinkatti8860
    @kaushaltopinkatti8860 6 ปีที่แล้ว +2

    Thanks Excellent Video

  • @Tristan-zr6gf
    @Tristan-zr6gf 3 ปีที่แล้ว

    Super cool video!! really well presented🥳🤙🤓 May I ask: if a user already filled out the text fields & pressed "Continue" without choosing an image - how to set / send a default image along for that user? Really would appreciate your take on this 🙏 Hope you all are well ⭐️

  • @martinsabev6508
    @martinsabev6508 4 ปีที่แล้ว +2

    Hi Replicode!
    Great tutorial! Thank you a lot!
    How much of this could be done with Firestore and swiftUI?
    Martin

  • @nikitalaptyonok9241
    @nikitalaptyonok9241 6 ปีที่แล้ว +3

    There was something changed in Firebase, now the line "if let url = metaData? .downloadURL () ?. absoluteString {" shows error "'downloadURL ()' is deprecated: Use` StorageReference.downloadURLWithCompletion () `to get a current download URL. " I'm only trying to understand programming and now I'm doing my first program and do not quite understand how to fix the correct program, can you tell?
    Sorry, I'm use Google Translate

    • @Replicode
      @Replicode  6 ปีที่แล้ว

      Hey Nikita, thanks for letting me know - I’ll look into this change!

  • @KokomoEcoS
    @KokomoEcoS 5 ปีที่แล้ว

    Thank you! Great video.

  • @jossydere3930
    @jossydere3930 4 ปีที่แล้ว

    thanks mate you are the best !

  • @neuro5813
    @neuro5813 3 ปีที่แล้ว

    You was the dev in RWDevCon Session for the MVVM Practice no ?

  • @IonWP
    @IonWP 5 ปีที่แล้ว +1

    How to save data into Firestore.firestore().reference but not in Database.database.reference() ????

  • @grigorhovhannisyan2417
    @grigorhovhannisyan2417 5 ปีที่แล้ว +4

    2:32 info: [UIImagePickerController.InfoKey : Any]) if let pickedImage = info[.originalImage] as? UIImage

  • @michaelmccord9419
    @michaelmccord9419 5 ปีที่แล้ว

    Hello! Your videos are awesome!! I'm learning so much. I'm having an issue though with things uploading to my database, but I think I might have created it wrong. The uid's aren't coming up and nothing for the username or photo url either. Any idea what I might have done wrong?

  • @BranGaming20
    @BranGaming20 4 ปีที่แล้ว

    hello, can i uploading image to cloudkit or it just for firebase? what is the different?

  • @ximenadelatijera
    @ximenadelatijera 6 ปีที่แล้ว

    is it posible to set up the profile image from another view controller but to the same user?

  • @thetimbology
    @thetimbology 6 ปีที่แล้ว +3

    Hey, i'm getting Value of type 'StorageMetadata' has no member 'downloadURL' on line 234 on the signupview controller. What do I do?

    • @brandonl955
      @brandonl955 6 ปีที่แล้ว

      I also have this error, because of release 5.0 of Firebase... Some news ?

    • @RobertHarrison
      @RobertHarrison 6 ปีที่แล้ว

      ya im stuck on that as well :(

    • @RobertHarrison
      @RobertHarrison 6 ปีที่แล้ว

      Ahh I was thinking about doing that, but had no idea really how to do so. To do that do i have to change the version in the pod file?

    • @isqueezerde
      @isqueezerde 6 ปีที่แล้ว

      i also need help about that .... please ... help

    • @RobertHarrison
      @RobertHarrison 6 ปีที่แล้ว +2

      Hey James helped me out with this one. In your podfile you have to downgrade the storage, add this exactly
      pod 'Firebase/Core'
      pod 'Firebase/Auth'
      pod 'Firebase/Database'
      pod 'Firebase/Storage', '~> 4.0'
      Then also make sure your database in firebase is set to true in the rules and it should work.

  • @emrehavan7456
    @emrehavan7456 6 ปีที่แล้ว +1

    Great tutorial so far, but newbies are stuck with this video since Firebase is changed and we have a problem. Metadata is nil, and we get an error inside uploadProfileImage method. Hence, we are unable to call saveProfile. Can you update the starter project or, at least give some information about it in your free time? That would be greatly appreciated. Thanks again for all your amazing work! Cheers.

    • @emrehavan7456
      @emrehavan7456 6 ปีที่แล้ว +2

      Damn it, it wasn't working because, first we should go to Firebase and go to Storage, then click on get started :D After that it works. But "metaData.downloadURL" is not working anymore, instead use
      storageRef.downloadURL(completion: { (url, error) in
      print(url)
      if error != nil {
      completion(nil)
      } else {
      completion(url?.absoluteURL)
      }
      })
      inside storageRef.putData method, after checking the error == nil and metaData != nil. Hope this helps.

    • @Replicode
      @Replicode  6 ปีที่แล้ว +1

      Thanks man, yea it's the one breaking change from the new Firebase. I'll add an annotation in the video! I'm glad you figured it out tho.

    • @adarlatak1543
      @adarlatak1543 4 ปีที่แล้ว

      @@emrehavan7456 hey I have a question for you, my computer keeps teling me this - Instance member 'putData' cannot be used on type 'StorageReference'; did you mean to use a value of this type instead? do you know what to do?

    • @adarlatak1543
      @adarlatak1543 4 ปีที่แล้ว

      never mind i fixed that and did as you said but now its telling me Cannot convert value of type '(Optional, _) -> ()' to expected argument type '(URL?, Error?) -> Void'

  • @scottgisaac
    @scottgisaac 5 ปีที่แล้ว

    I’ve copied your implementation almost exactly but writing data to the database ( the code that creates a user profile I.e the function saveProfile) is unbelievably slow takes almost a minute for it to complete. Any idea? My internet connect is fast.

  • @timriordan2422
    @timriordan2422 6 ปีที่แล้ว

    The sign up process time with/without profile image code seems to take a lot longer for me than it does for you - about 4s/12s vs. your 1s/3s. Any idea why?

  • @adarlatak1543
    @adarlatak1543 4 ปีที่แล้ว

    if i wanted to add another photo onto that page what code would i add?
    Thanx man!!!

  • @rishabgupta5228
    @rishabgupta5228 5 ปีที่แล้ว

    Hello. When I am uploading pictures to the image view in the circular image view there are black borders going around it. How do I make it so it looks like yours and takes uo the entire image view? Nice vid!

  • @jdvillanueva4361
    @jdvillanueva4361 4 ปีที่แล้ว

    Hello,
    Using your code everything builds and runs correctly, but i keep getting "an ssl error has occurred and a secure connection to the server cannot be made", along with a bunch of other errors pertaining to this. Ive searched the internet and implemented their solutions but i keep getting the same error. Its not letting me upload to firestore. Any help would be appreciated.

  • @erencelik964
    @erencelik964 4 ปีที่แล้ว

    dude projectfiles link not workink please

  • @FlowneWoW
    @FlowneWoW 6 ปีที่แล้ว

    Hey I was wondering if you could do a video like this but with Firestore. For example I want a person to add an image and a text field. This image + caption later gets pulled from the DB to showcase it to the user.

    • @Replicode
      @Replicode  6 ปีที่แล้ว

      Hey! Yea I will be making a Firestore tutorial soon. I have been using it recently and it has a lot of advantages (and some disadvantages). In the mean time, just read up on the Firestore docs, its just as easy as the Realtime Database! For example, to write to Firestore you just say:
      Firestore.firestore().collection(‘posts’).addDocument([“imageURL:..., “caption:...])

  • @mohamedbenabdallah5633
    @mohamedbenabdallah5633 5 ปีที่แล้ว

    What if I wanted to give the personnel the ability to add 2 side by side pictures?
    In order to review before and after pictures of their own.

    • @adarlatak1543
      @adarlatak1543 4 ปีที่แล้ว

      hey man did you ever figure out how you could do this?

  • @tonycalves8642
    @tonycalves8642 6 ปีที่แล้ว

    Hey, I've followed all your videos. And thanks ! But when I try to Sign up with a picture, firebase tells me : Permission denied.. and if I click on the back button (top left), it connect me and show me the view when I'm loggin.... I don't understand why.. Thanks again for your vids !

    • @Replicode
      @Replicode  6 ปีที่แล้ว

      Hey Anthony, let me know if your still having this issue and we can work through it!

  • @RobertHarrison
    @RobertHarrison 6 ปีที่แล้ว +2

    (QUICK UPDATE) to help everyone save time
    1. Downgrade your podfile storage firebase, like this in podfile
    pod 'Firebase/Core'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'
    pod 'Firebase/Storage', '~> 4.0'
    2. Firebase has this cloud database now, make sure you dont select that in firebase and also set your rules to be true, like this
    {
    /* Visit firebase.google.com/docs/database/security to learn more about security rules. */
    "rules": {
    ".read": true,
    ".write": true
    }
    }

  • @sasniyFriz
    @sasniyFriz 5 ปีที่แล้ว

    like for shepard, it was completely unexpected

  • @designerbeba92
    @designerbeba92 5 ปีที่แล้ว

    UIImageJPEGRepresentation doesn't appear why!

    • @Replicode
      @Replicode  5 ปีที่แล้ว

      Designer Beba if ur using Swift 4+ use this instead: image.jpegData(compressionQuality: 0.75) else { return }
      It’s a UIImage class function now!

    • @designerbeba92
      @designerbeba92 5 ปีที่แล้ว

      Replicode you mean 'image' is my own image to compress to upload to firebase??

    • @Replicode
      @Replicode  5 ปีที่แล้ว

      @@designerbeba92 Thats right! Something like this:
      let myImage = UIImage(named: "hello.png")!
      let compressedImage = myImage.jpegData(compressionQuality: 0.75)

    • @designerbeba92
      @designerbeba92 5 ปีที่แล้ว

      Replicode thanks so much, but my problem is my image pick up from photos library so how I deal with!

    • @Replicode
      @Replicode  5 ปีที่แล้ว

      @@designerbeba92 np! Okay are you using the UIImagePickerController to select an image from the photos library?

  • @anton5688
    @anton5688 6 ปีที่แล้ว

    First

  • @ancientplayer3409
    @ancientplayer3409 6 ปีที่แล้ว +1

    Would you happen to know how to disable/gray out the login button if both email and password textFields do not have any characters in them?

    • @Replicode
      @Replicode  6 ปีที่แล้ว +1

      For textfields, I usually use this method rather than the UITextFieldDelegate methods:
      textField.addTarget(self, action: #selector(textFieldDidChange), for: .editingChanged)
      @objc func textFieldDidChange() {
      let text = textField.text ?? ""
      if text.isEmpty {
      print("Textfield is empty")
      } else {
      print("Textfield has text: \(text)")
      }
      }

    • @Replicode
      @Replicode  6 ปีที่แล้ว +1

      Just note, that if you are using UITextViews and not UITextFields, there is a 'textViewDidChange' method in the UITextViewDelegate, so use that instead.

    • @ancientplayer3409
      @ancientplayer3409 6 ปีที่แล้ว

      Thank you! It worked!