9
xPanther
85d

I am developing a REST api for my android app using laravel.I want to implement web to mobile chat like Facebook's messenger.Any suggestions?

Comments
  • 4
    Perhaps a web socket?
  • 6
    I suggest you to implement a new facebook
  • 4
    I would use websocket, as @alexbrooklyn said, and Firebase for receiving notifications on mobile when app is not active.
  • 1
    @CoffeeAndHate I found an article about socket.io Redis and laravel but it wasn't clear enough. Can you explain more the utility of firebase in this scenario?
  • 2
    You will need Firebase if you want your users to receive notifications after they close the app.
    You won't be able to keep the websocket or any socket connection opened indefinitely because Android will eventually terminate it once the app closes.

    Firebase sends notifications through Google Play Services, which is a process that is always connected to their servers.
  • 1
    @CoffeeAndHate I understood. Now concerning real-time chat .I found tutorials about creating a chat platform between mobile devices .However I want to build a chat platform between a web user and mobile user .Did you ever work on this kind of project if so a good advice might help me a lot
  • 1
  • 2
    @xPanther It would be more easy if you have specific questions, as I am not good at giving advices.

    I would mention that php is a bad choice for the actual chat server. Choose something else, something that supports multithreading - which is pretty much anything other than php.

    You can continue using laravel for what you are building, but not the chat server.
  • 4
    Switch your stack. Use nodejs with express and socket.io as backend and something js based for the front end like angular. You need socket.io in the frontend too.
  • 4
    @xPanther it run on the same backend server, the platform doesn’t matter, both mobile and web read from same database
  • 1
    @devTea What are you using for back end server dev?
  • 2
    Literally any RESTful backend will do the trick. Sure something that natively supports multi-threading would be nice but, eh, unless you're planning on having a a TON of traffic it won't matter.

    Redis, Memcached, Laravel WebSockets and whatever you want for the frontend (I'd suggest Vue). I don't know mobile development but I do know web and that's how I'd do it if I were going to.
  • 1
    use rocket chat
  • 2
    @Charon92 Can I DM here on devRant .I'm new to this app
  • 0
    @xPanther

    Not on here but I'm on Discord most nights. Usually the DevRant one.
Your Job Suck?
Get a Better Job
Add Comment