0

Me and my team are trying to create a messaging app with image upload in the messagr app using firebase. Do you have any references on how we can upload an image in our chat application?

2 Answers2

3

It's not that you are uploading an image to firebase chat.

1) You can upload image to your own server or use firebase storage.

2) Store that image url in your chat instead of thinking of storing image in chat.

Simply just specify the chat message type to identify and display view accordingly. If chat type is text, just show the text message. If chat type is image, load an image from the url you have stored.

Ravi
  • 34,851
  • 21
  • 122
  • 183
1

As described here, You can upload files to for

// Create file metadata including the content type
var metadata = {
  contentType: 'image/jpeg',
};

// Upload the file and metadata
var uploadTask = storageRef.child('images/mountains.jpg').put(file, metadata); 
  • Well i was just wondering if i can open my camera through my app then i can take a photo then send it to the recipient – Lesz Paul Mendiola Jul 10 '18 at 09:24
  • Yes of course, which language you use ? It is possible and not that hard to accomplish. –  Jul 10 '18 at 10:14
  • Well we are just beginners in the field of programming and we are using Android Studio with firebase. If you wont mind could you kindly give us the code or reference that would be very helpful for us. We need your help... Thanks! – Lesz Paul Mendiola Jul 10 '18 at 11:23
  • https://stackoverflow.com/a/13977619/4799206 –  Jul 10 '18 at 11:26
  • After taking a photo through the chat. Will it directly be sent to the chat or does it need additional codes for confirmation of sending the photo? – Lesz Paul Mendiola Jul 10 '18 at 12:14
  • Of course, you need to add additional code to your existent system. I know you are not that experienced but it will not that hard to implement. There are very handful sources in the internet to help you, just go step by step with careful testing and be sure you will get want you want. –  Jul 10 '18 at 12:49