简体   繁体   中英

How to save an image from a link to Firebase storage with firebase web?

In my iOS App I want to display an image of a webcam: https://www.alpenblickzeneggen.ch/fileadmin/user_upload/webcamBild.jpg .

But with iOS 10 and AppTransportSecurity and all those problems I think it's better to do it otherwise:

  • Get the image from the link with Firebase for the web
  • Save that image to Firebase storage
  • Download the image in my iOS App from Firebase storage

But, how can I do that? Is it possible?

So long as the site is using reasonably modern ciphers, ATS isn't going to be a problem here...

If you're already storing your image somewhere else, just use something like SDWebImage to download and display your image:

@import SDWebImage

imageView.sd_setImage(with: URL(string: "https://www.alpenblickzeneggen.ch/fileadmin/user_upload/webcamBild.jpg"), placeholderImage: UIImage(named: "placeholder.png"))

If the image is changing, and you need a place to store that data, Firebase Storage is a good choice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM