Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5 android Chat with Push Notifications like Whatsapp

I need a Chat system in my android app. My backend is Laravel 5 api. I know I can use websockets for chat but I want push Notification when the app is closed like Whatsapp. I know jabber can be used for real time chat but will it work if app is closed? Can i use jabber with laravel? I have seen this laravel package: Push Notifications but it needs device token which I don't know how to use or get. What if a user logs into multiple devices? How to identify a device uniquely? Should the entire chat be on Push notifications or just ask user to open the app and then show messages in app? I am very confused with this functionality could someone guide me?

like image 342
rohitnaidu19 Avatar asked Nov 18 '15 06:11

rohitnaidu19


1 Answers

The link you provided for the Laravel packages is asking for the Android GCM api key for your app. If you follow this tutorial here, halfway down the page it tells you step by step how to get a GCM API key. Once you get the api key for your app, just input it into your config file like the readme states on GitHub.

Here's the link to the tutorial: Click Here!

Once you have that, you can click on this link to send a push notification to multiple devices at once. Or pick a single device.

I've tried both and they are easy to follow and work perfectly. Hope this helps.

Note: if these links ever change, I will update them accordingly.

like image 185
Steve C. Avatar answered Nov 03 '22 09:11

Steve C.