1

Have 2 apps on separate devices: Rider & Driver.

Let's say, the Driver needs to contact the Rider via messaging, or vice versa, is there a way to do it without using the stocked message app to protect privacy?

My idea was to create on both apps an empty box, add a text view for the message and send button and add the msgs to firebase db. Unfortunately, i am not sure how i would do it in Android as well as the response.

Any suggestions or how to's would be greatly appreciated.

LizG
  • 2,246
  • 1
  • 23
  • 38

2 Answers2

1

You could probably integrate your app with Firebase.

For simple messaging, you could use Firebase Cloud Firestore to do it and for notification, you can use Firebase Cloud Messaging.

Messaging

You can have a sub-collection to store all the chats between the rider and driver in the form of documents. 1 chat will be a document storing the info such as time, sender, as well as message.

Notification

From the doc:

Send acknowledgments, chats, and other messages from devices back to your server over FCM’s reliable and battery-efficient connection channel.

You could start research from Firebase sample application.

Highly recommend you go through this third party tutorial: Firebase Tutorial: Real-time Chat to get some idea, it's in iOS but the concept is the same.

Angus
  • 3,680
  • 1
  • 12
  • 27
  • I was thinking more of this idea ... when the rider or driver click on a chat bubble button, it opens an empty box where they can type their message and then click SEND. Then the person receiving the msg, sees a flashing button where it opens the msg so they can read or respond. The chats can be stored to the db.Anyone have any idea how I can do that? – LizG Sep 25 '18 at 21:22
  • I guess that would be another question as you did not state it earlier – Angus Sep 26 '18 at 01:13
  • Not really. I am still trying to integrate a messaging feature into my app. It can still use firebase. I just dont want to create a chat app and integrate that into the app – LizG Sep 26 '18 at 02:02
  • I found a youtube tutorial that pretty much does what you suggested. https://www.youtube.com/watch?v=Hn_wfTqFbdg&t=547s Thanks for the help and the direction :) – LizG Sep 27 '18 at 23:22
  • I did follow that series before, great that you found it! – Angus Sep 28 '18 at 02:47
0

Yes, there is a way to do it.

Actually you can use any messaging platform, e.g. Firebase, ConnectyCube, Twillio, Layer etc.

All of them provide API & SDK for iOS, Android and Web for chat so you can easily do it using it.

I used ConnectyCube some time ago, it can be done in the following way:

  1. Initialize app
  2. Sign Up user
  3. Connect to chat
  4. Create a chat dialog with other user
  5. Send/Receive messages

More detailed chat code sample for Android can be found here

Most of the above platforms provide a cloud hosted plan, but some of them also provide an Enterprise plan when you the whole platform can be installed at your AWS/Google/Azure account, so hence the privacy is the best because you own all your data

Rubycon
  • 18,156
  • 10
  • 49
  • 70