1

I am encountering some big problems while using the pod MessageKit and the server/website ScaleDrone in Swift 5.0. I really need your help.

What I want: I would like to make a "chat" VC in my app. Before this VC, there is a Table VC with contacts as cells. When you click on it, I would like to send to the chat VC the object ID (or username I don't know how it works?) and it comes out with the previous messages sent between the current user and the selected user.

What I did: I followed to the letter this tutorial and I can send messages to myself but not between two devices and when I go back and return to the chat, there are no previous messages.

Do I need to do a "registration" as I found on the GitHub source ? I don't think giving you my code would be necessary as I said I copied everything from this tutorial.

Looking forward to your help of experienced programmers, if you couldn't see what's wrong with my case, I would be glad to know your method of making a chat app with a database (with Parse if possible).

Auyem
  • 51
  • 6
  • A real-time messaging service in this context just means delivering messages in real-time, not having channels with persisted messages. I don't know why you can't send messages across devices, but you will have to build much of the chat infrastructure yourself to keep track of messages and users over time, either on a central server or locally on everyone's device. There may be other solutions that already offer this. – Jesper Apr 09 '19 at 08:30
  • @Auyem Are you trying to make Realtimechat? or just a normal chat between phones? – Harjot Singh Apr 09 '19 at 08:35
  • @HarjotSingh well, I don't really get the difference but I think that's a normal chat, very common, but I can't see how to do this properly – Auyem Apr 09 '19 at 08:42
  • @Auyem i assume your making a realtime chat is that correct? like whatsapp? – Harjot Singh Apr 09 '19 at 08:42
  • [I missed this part of the ScaleDrone readme](https://github.com/ScaleDrone/scaledrone-swift#message-history) - it looks like they do provide message history but it has to be enabled. (And probably affects pricing.) If you're aiming to build a chat service with persistent messages where you can go back to look through it, you'll probably need something more detailed than "always send the previous X messages" though. – Jesper Apr 09 '19 at 08:43
  • @HarjotSingh exactly, I would be like WhatsApp, but if possible though ScaleDrone, MessageKit – Auyem Apr 09 '19 at 08:44
  • @Auyem Why don't you try Firebase Realtime database as your backend and make the UI yourself? Store the previous messages in locally to show them when the user is offline in CoreData, when user comes online you can use the Firebase Database – Harjot Singh Apr 09 '19 at 08:46
  • @HarjotSingh ty for your answer, OK I think I am going to try that, but I am a non-experienced programmer so it could be more difficult but why not – Auyem Apr 09 '19 at 08:48
  • Glad to help but you should use `Firebase` as it is easy and very frequently used. Otherwise, what whatsapp is using its `XMPP` protocol as their backend, you could use that too but in this case you need to setup backend server as well with `XMPP` support. – Harjot Singh Apr 09 '19 at 08:52
  • 1
    @HarjotSingh I'm gonna see how is Firebase, ty – Auyem Apr 09 '19 at 08:54
  • https://www.raywenderlich.com/5359-firebase-tutorial-real-time-chat This might help. MessageKit with Firebase – Victor Sanchez Apr 29 '19 at 12:48

0 Answers0