Building chat application with Laravel and Mobile clients (iOS and Android) - android

We are building a full chat system with Laravel (Back-end) and mobile applications (iOS and Android). It is a completely one to one chat system.
Chat can be between mobile to mobile client
Chat can be between a mobile client and admin on the web panel (laravel)
We want all the data on our server so that admin can access the data anytime. For example, admin should be able to see the chat/conversation between two users.
System will support text messages, sending files/images, share location etc.
We have looked for some options like Pusher but it gets a bit too expensive when you have a lot of users.
What would you guys suggest? I would love your advice.
Thank you.

You have 2 options here:
Implement by yourself
In your case you need the following:
Install some XMPP server in your cloud. It could be something like Ejabberd, Prosody, Tigase, Openfire
On client side - use XMPP libs to connect to XMPP server and to send/receive messages. For iOS it's XMPPFramework, for Android - Smack
On Web/Web panel - use StropheJS
for any service tasks - there are also XMPP libs for PHP
Use some messaging SaaS platforms
Except Pusher, there are also lot's of diff messaging platforms e.g Twillio, Layer, ConnectyCube, Applozic etc.
I used ConnectyCube some time ago, they support Messaging, Video Calling and Push Notifications functionality for iOS, Android and Web. They also have some ready code samples available, so can some some time on start. Pricing is a competitive one. So it can be done in the following way:
iOS Chat SDK https://developers.connectycube.com/ios/messaging
Android Chat SDK https://developers.connectycube.com/android/messaging
Javascript/Web Chat SDK https://developers.connectycube.com/js/messaging
Hope it will be helpful for you

Related

Sending message from web browser plugin to android and IOS application using XMPP

I am developing an application that needs to send message from my web browser plugin to my android or IOS app client and get response back on the plugin.
I found XMPP as an option for that but it requires separate jabberID(JID) for each client. But I need to use the same ID lets say users Gmail ID on both the plugin and the mobile application.
Is there any work around so that same Id can be used in the plugin and mobile app or if there is a better way to do this.
You should take a look at Google Cloud Messaging. The underlying protocol is actually XMPP, and it can efficiently push messages between your server (or client!) and Chrome, Android and iOS.
It also comes with powerful features like Device Groups, which let you send a single push message to Google and have it pushed out to numerous devices at once.
For your specific use case, check out the Chrome and Android docs for GCM.

How Can An App Communicate With a Server and reflect updates immediatly?

hi this is just for knowledge. i will try to explain as much as i can what is my question.
Usually i call on an Async Service every amount of time i.e updates on the server part for example are not reflected as soon as they change. whatsapp for example reflects the updates almost instantly. for example when a user is typing, it shows to the other user that he is typing.
In short what protocols do they use and how do they use it.
thank you.
What protocols do they use?
Application like Whats app,G-talk ,facebook etc they uses XMPP protocol for IM services.
What is XMPP?
The Extensible Messaging and Presence Protocol (XMPP) is an open
technology for real-time communication, using the Extensible Markup
Language (XML) as the base format for exchanging information. In
essence, XMPP provides a way to send small pieces of XML from one
entity to another in close to real time
As per latest version of specifications XMPP provides below services
Channel encryption [RFC3920]
Authentication [RFC3920]
Presence [RFC3921]
Contact lists [RFC3921]
One-to-one messaging [RFC3920]
Multi-party messaging [XEP-0045]
Notifications [XEP-0060]
Service discovery [XEP-0030]
Capabilities advertisement [XEP-0115]
Structured data forms [XEP-0004]
Workflow management [XEP-0050]
Peer-to-peer media sessions [XEP-0166]
This are the core services available in XMPP
Below are some Applications where XMPP can be used
Instant messaging
Groupchat
Gaming
Systems control
Geolocation
Middleware and cloud computing
Data syndication
Voice over IP (VoIP)
Identity services
Like HTTP XMPP also require server-client implementation
Below are some popular XMPP servers
Ejabberd
Openfire
Prosody
Tigase
You can find more information on xmpp server on this link
Different platform has their different XMPP client library you can more information on this link
If you want to implement XMPP client for android then you can use Smack 4.1 ,it is an open source XMPP client library written in java.
I have tried to list down basic feature of XMPP here but if you getting started with xmpp ,then there are lost of things to learn , free to ask any doubt regarding XMPP I will try my best .
Thank you
Note::
for the user who are still using aSmack should Upgrade to Smack 4.1 as aSmack has been deprecated!!
aSmack Deprecation Notice
aSmack to Smack Upgrade guide
You could implement the Google Cloud Messaging (GCM) service, as the GCM site says:
Google Cloud Messaging (GCM) for Android is a service that allows you
to send data from your server to your users' Android-powered device,
and also to receive messages from devices on the same connection...
This way you can inform from one client a status change, the backend then send the propper message to the desired clients and finally those clients app updates the status.
https://developer.android.com/google/gcm/index.html

NodeJS to android app communication

I'm making a NodeJS server and an Android app that goes with it. I need to send alerts to my mobile app users that's coming from the web server. Something like a a chat app on the server and the android users getting the messages also (Facebook messenger?).
I have the server ready and Android app communicating to its database (for user login/getting user info/etc) using REST. I just need to figure out how to send info to the Android app WITH THE SERVER INITIATING COMMUNICATION. Any advice on where to start?
Start by looking at Google Cloud Messaging.
It's a free service that accepts messages from your server-based program and queues it to be sent to phones with your app when the phones are online.
Here is the overview on Android Developers.
YES!
Working with NodeJS, you have probably already heard of Socket.IO.
I'd say: Start there!
For your app to communicate with the server, there's also the java lib. These are great tools to start making any good real time service.
After you get along with this, you should also check GCM as #krisLarson suggested. And talkign about GCM, you have Node-GCM to make your work even easier.
Good luck!

How do Asp.net backend and Web API web service hosted on Azure send push notification to mobile app?

I am building a mobile app, for both Android and iPhone. I outsourced the mobile end to an app company, while I myself develop the back end and web service part with asp.net and hosted them on Azure. The web service is developed with Web API 2.0, and it is deployed to Azure as a web site. The back-end is developed with asp.net web forms and deployed in to Azure as a web site.
There are 2 cases when a mobile user will receive some messages:
(1) When some mobile users post some messages, other mobile users will receive them.
(2) In the back end, if an administrator publishes a message, all mobile users will receive it.
Currently in my back end and web service, when mobile user post message or an administrator publishes a message, I just update database table to save that message. I thought the mobile end will keep pulling database table and get the latest message - until today. Today the app company told me I need to PUSH those messages to phones. He suggested some third party service to achieve this.
I then checked Azure documents, it seems they have built-in push function in their service so that I don't need go for a third party service. But I am confused, I saw there is "Cloud Services", there is "Mobile Services", and there is "Service Bus-Notification Hub". Which one should I use to make my back end and web service be able to send push notification to mobile devices? How should I modify my existing back end and web service projects in Visual Studio Express 2013? Do I still deploy them to Azure as web sites?
by message, I don't mean SMS, I mean some text data.
Given that you've already invested some reasonable development time in both the Android Application and your back-end services, it sounds like you're looking for Notification Hubs. Notification Hubs are designed specifically for sending push notifications to both individual users and groups of users across one or more mobile platforms.
As suggested in my comment, Cloud Services is a means of hosting your application on Azure (for your purposes it would offer a heavier-weight alternative to Azure Websites with an improved SLA), and Mobile Services provides a set of libraries and APIs to abstract interacting with your application's server-side data.
To use a Notification Hub to send push notifications you'll need to do a few things (described in detail in the linked documentation):
Go to the portal and create yourself a new Notification Hub
Create a Google Cloud Messaging Project via the Google Cloud Console (Azure will use this to transport your message to the relevant Android devices)
Update your back-end service to use Notification Hub to send messages
Modify your android application to use the the associated Azure messaging libraries to receive your push notifications
I hate to link directly to documentation, but the best way to get started with this functionality is via the following tutorial from the Azure documentation:
http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-android-get-started/. This covers the basic changes you'll need to make to both your Android application to handle push notifications, and to your back-end service in order to send them.
You'll still be able to deploy your server-side components to Azure Websites.
Note that sending messages via Notification Hub comes with a price tag, though there is a free tier that limits you to 500 devices and 100,000 push notifications per month, as described in http://azure.microsoft.com/en-us/pricing/details/notification-hubs/.
EDIT: Here's an example of using Notification Hub to send messages to individual users:
http://azure.microsoft.com/en-us/documentation/articles/notification-hubs-aspnet-notify-users/

Right way to establish push notifications for Android/iOS

Assuming my application is based on HTML5/Jquery mobile (Cross platform web app),
How is it possible to create push notifications for Android/iOS ?
Also, does it include developing different "notifications engine" for
each device? (in other words: Do I need to implement two different background processes for each type of device?)
I'd be really glad to get a full answer/references to my conflict.
I have searched for the forum's previous answers but it seems like the threads are quite old so i preferred opening my own question.
GCM is the Google Cloud Messaging Service for Android, while APNS is the push notification service for iOS, both of them are very similar.
If you're already using html5 and jQuery, I would suggest you to use Phonegap which is a framework that allows you to create mobile apps using only html5 css3 javascript(jQuery) it was very useful for me and they've a push notifications plugin which works for Android and iOS.
Be sure to check Phonegap and Phonegap Build (which is a very interesting service)
Regards
1)
Apple has Apple Push Notification Service (APNS) to push out alerts.
More details at
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html.
Google offers a comparable Google Cloud Messaging Service (GCM).
Details at http://developer.android.com/google/gcm/index.html. UPDATE: GCM does support iOS as a client, so can be used for both Android and iOS, with some work. (Technically, it will be an APNS when it reaches the iOS device.)
2) Not sure I understand what you mean by "background processes", If you are referring to backend service/originator of notifications,then the service needs to be able to communicate i with both the Apple APNS or Google CDM using the interfaces supported by these services and send out alerts in appropriate format. If you are looking for a third party service for sending out push notifications, you can checkout UrbanAirship or Parse which can send notifications to either platform.

Categories

Resources