11

I am currently trying to build a chat application in swift whilst using Firebase for real-time messaging. My only issue is I want users to send images, I want them to have profiles with images but I know Firebase has limited storage (or at least storage per pay tier is low for the number of connections you get)

So I would like to know how to connect up another database and make calls when needed between the two. So when and image is sent in a message, rather than Firebase storing the image, it stores a URL to the image in the other database.

I am under the impression something like AWS S3 is my best bet. any help is appreciated!

Dom Bryan
  • 1,238
  • 2
  • 19
  • 39

1 Answers1

8

This question has been asked before and there are a number of solutions. It's kind of an 'opinion' type question but here are a few options.

View and store images in Firebase

Firebase has a 10Mb capacity, which is adequate for many images. However, if you need larger, they can be easily encoded as base64 and split into chunks.

If you want to go external:

s3 or Filepicker (Filestack) as well as Google provide some options.

Not sure of the overall requirements but obviously you can dig into CloudKit / CoreData and even Dropbox offers an API.

I have zero experience with Box but it may be an option as well.

Each option has it's own API.

In general, you would store a link in a firebase node to the image/object in question. However, the mechanics of that vary wildly as interfacing with CloudKit/CoreData will be different than say Filepicker.

With CoreData you will have to roll your own reference scheme whereas Filepicker you can have an almost direct reference to the file.

Many of these services provide a free or low cost tryouts and you can whip some code up in a manner of a few minutes to test out the functionality to see if it may meet your requirement.

If you need help encoding/decoding, see the answer to this question

Swift2 retrieving images from Firebase

Once you get rolling, if you have issues post some code in another question.

Community
  • 1
  • 1
Jay
  • 34,438
  • 18
  • 52
  • 81