want to understand whatsapp work flow and architecture - whatsapp

I have some questions like how whatsapp server is working, though I read in internet, I want to understand much. And what is XMPP? how it is working, How can I send data through XMPP. how can I integrate XMPP with application, can anyone pls explain?

WhatsApp under the hood?
There are rumors WhatsApp uses a customized version of XMPP. Sources are closed so we can only guess.
Understanding XMPP will however give you all the tools to create your own WhatsApp clone.
What is XMPP?
According to Wikipedia (which hosts further references):
Extensible Messaging and Presence Protocol (XMPP) is a communications protocol for message-oriented middleware based on XML (Extensible Markup Language).
Which is to say that XMPP is an xml based convention for exchanging messages between parties. It's best known implementation is Ejabberd chat server.
XMPP can however be used for other things, among them the web of things.
How to send messages?
Assuming you want to create a chat application, you will need:
An Ejjaberd server up and running.
An appropriate xmpp SDK for you language/framework. Example: Smack for Java or agsXMPP for C#.
A good kick-starting tutorial about how xmpp works can he found here: part one and part two.
There is also the RFC which contains the most comprehensive documentation out there.

Related

Architecture and technologies of an instant chat app in flutter

I want to build an instant chat app with flutter without any third party services.
I've been working in a simple app using a restful laravel api for login, multiple methods and logout, using token authentication for each request. However, I find that architecture not suitable for a modern instant chat. I discovered WebSockets, which sound great, but can't yet grasp how I could subscribe to and consume one from flutter. I´ve read about web channels, but I'm not sure how they handle authentication for users. Is it possible to handshake and establish a session from my app? If so, how?
Or, can it be done totally restful? How could I post messages and listen other user's messages in that case?
Besides the chat functionality, is it recommended to work restfully? Or is flutter able to mantain a solid, authenticated session? I'm kinda new in flutter.
I appreciate any info, link or recommendation. Please, refrain if you were going to mention firebase, I want to build my own backend. Thanks!!
You should check out MQTT, an IOT protocol which is currently used for chat applications very widely.
To know about MQTT, see this.
But first I will recommend you to understand Pub-Sub(Publisher-Subscriber) Model, if you understand it then that's great.
For pub-sub model, see this.
Or, can it be done totally restful? How could I post messages and listen other user's messages in that case?
Yes, it can be done totally restful but honestly it's not recommended. You should do it with websockets.
Besides the chat functionality, is it recommended to work restfully? Or is flutter able to maintain a solid, authenticated session? I'm kinda new in flutter.
Depends on your architectural choice. There are many good options on which architecture you want to choose. Apart from restful there is GraphQL also, if you are comfortable with it. Apart from chat functionality mostly you will see people using RESTful but people who know GraphQL, might also use that instead of RESTful.

Server Architecture .net/cocoa app

I'm planing on creating an native .net app for Windows as well as a native OSX application with swift.
These two applications should be able to communicate with the same server. With that I mean writing and reading from the same SQL Database, and have REST communication with the server.
Now I'm struggling to come up with a solution for the backend. I'm looking into Serverless backends like Azure or Google Cloud, but I'm not sure that I can use these Services with both my applications. Both Azure and Google Cloud have SDKs for .Net but I've never found one for Swift or Objective-C.
Are there such Services that allow me to communicate or should I just develop my own?
Do you have any good solutions for my problem? Or what is the best server architecture to use for this kind of problem? Any inputs are appreciated!
If your servers vend a REST API, no vendor SDKs should be required. REST is platform- and vendor-agnostic. All you need is an HTTP client, which Swift/ObjC most definitely do have. I use a serverless (AWS Lambda) setup from Swift, and it's easy. Though, I have done this kind of thing before :)
What I would do is setup a simple test server, and expose an API endpoint. Make sure you can reach it with curl from your machine. Then, take a look at the NSURLSession APIs in Foundation. They'll help you make an HTTP request similar to what curl can do. From there, you'll need to investigate serialization (like JSON), which Swift can also do easily (as of Swift 4, I believe).
Good luck!

GCM (Google Cloud Messaging) Bulk with Linux

Does any one have idea about the best way(implantation) to send Bulk Google Cloud Messaging on a Linux server. (Personally I like non-java implementation) Any help, link or suggession appreciated.
Edit
I didn't try any method for bulk messaging. I know there is a php implementation for GCM too, But I like to know what should I consider before go for an implementation. Like, How to handle failed messages, Is there any limitation on http requests goes to GCM server, etc.
Finally, I found the best answer for my own question. We can send a message to 1000 Google could message recipients using one http request. Sending bulk messaging Shouldn't be that much complicated. Any language or tool are capable of sending appropriate http request to the GCM server is enough.
GCM allows you to attach up to 1,000 recipients to a single message,
letting you easily contact large user bases quickly when appropriate,
while minimizing the work load on your server.
As shown by this example, it seems that the server-side code can even be written in C#. This question also confirms that this approach works. Other people seems to be able to setup standalone Java applications, as shown here.
If you have to setup a Linux server to send GCM push notifications, you can freely chose to use C# or Java at your own discretion.
For what concerns C/C++, however, things are a little more complicated. This question (PHP) shows that GCM notifications can be sent using CURL, so I suspect that a "C/C++" implementation using libCurl could be possible. However you'll have to tweak it yourself, given that it does not seem to be the "standard way" to use GCM.
If you are familiar with PHP than implement it in PHP. Since GCM uses only 2 GETs with HTTPS, you can easily implement it in any language, even batch processing with curl (i am using this for testing). You can find the calls here.
Note that you need a curl.exe which is capable of doing HTTPS. The link from Avio's answer shows you how to do that in PHP, stick to that and do not use C++.

Can I create a Hangout "client" program? (kind of Google TalkAbout)

As stated in the Google Talk for Developers site, you can use the provided APIs to build a client that connects to the Google Talk service.
I would like to know if it's possible (or it will be in the near future) to build a similar client to the google hangouts.
What we pretend is to build something similar to cloud print, that provides printing services to the cloud, but for audio/video streaming: a camera and microphone would replace the
printer.
Thanks a lot.
Talk and all the XMPP stuff is going to be put down soon.
The new Hangouts infrastructure is proprietary. It only has API to integrate Hangouts into web pages and applications, but no API or protocol to create an alternative Hangouts client software.
https://github.com/tdryer/hangups is a library that does exactly that, with a command-line client for Linux.
https://github.com/xmikos/qhangups is a PyQt-based cross-platform app that aims to provide an open-source alternative to the Chrome-based official desktop app. Unfortunately it's not working at the time of posting, but the author is investigating the issue.

SMS API Suggestions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am looking for several SMS api.
Basically to receive sms messages from mobile phones.
Any suggestions?
There are two basic "SMS API's": SMPP and HTTP.
The SMPP interface is a world-wide standard used internally by cellular telephone companies as well as between SMS send/receive clients and those telcos and SMS Aggregators. I recommend reading the SMPP v5.0 specfication. The general international support for SMPP claims "SMPP v3.4 compliance", but operationally, SMPP v5.0 is little changed from 3.4 except that the documentation is much better. The SMPP v3.4 specification document was a bit sparse, and the SMS Forum greatly enhanced the specification document with version 5.0.
SMPP is the specification that documents a means of sending and receiving SMS between two nodes: the ESME or client side, which would be you, and the MC or "telco" side, which would be the telephone company or SMS aggregator with which you contract to be hooked into the international SMS infrastructure.
SMPP is needed if you are implementing for high volume, i.e.: multiple SMS per second. The SMPP protocol is a binary PDU request/response pair protocol that runs over TCP. The fundamental request/response pair protocol is relatively simple, but the SMPP specification has many extensions, and in the real world things get pretty complicated due to the sheer number of extensions and inconsistency in how various features of SMPP are implemented by various software and telcos. Using SMPP requires that you have a daemon / service running continuously to provide the real time SMPP peer communications facility, and cannot be implemented purely within web app code. Integrating SMPP into a web application requires developing a daemon / service to handle the ESME part of the SMPP ESME / MC pair, and then providing some kind of RPC mechanism between that daemon and your web app.
An example of an SMPP Library is Logica. Logica was a pioneer in development of SMPP SMSC's, and has released this library as open source. One of the very few that run on Windows. Most open source SMPP code runs on *nix.
Alternatively, one can use third party SMPP Gateway software. By far the most widely adopted open source SMPP server is Kannel. I know several SMS aggregators that use it. As you are asking about PHP and I presume Linux, integrating with Kannel may be your best bet. I do warn you that it is non-trivial to configure. There are several non-open source ones available too such as the Ozeki Message Server and Nordic Messaging Technologies' Enterprise Message Server (EMG). Both of these offerings provide a more "turn-key" solution than Kannel and may be more appropriate for your uses.
For lower volume applications, it is much simpler to implement an HTTP interface to an SMS Aggregator. There are many SMS Aggregators out there offering HTTP interfaces. There is no universal standard, but nearly all offer a relatively simple GET/POST HTTP interface that is quite simple to integrate into a web app or any software environment where HTTP GET/POST is well supported. The SMS Aggregators also generally offer some file or XML based interface for higher volume sending. As the above reader mentioned, Clickatell is an example of an SMS Aggregator, they are considered "pioneers in the industry." Another example, one I've used is Routo Messaging.
Each SMS Aggregator has their own HTTP API, though most all of them support the same services. Also, most of them offer a few free test credits. I have written code to test with several of them, and it is a simple few hour process, generally less than an hour once you have written one.
If you looking for a sms service provider? You could try Clickatell
If you looking at creating a sms api, look at the Twitter API
You can use SMSSync, a free and open source SMS gateway for Android.
It will receive SMS on your Android Phone, then do a HTTP POST to a URL you specify within the app.
However, note services like these will have a throughput limitation (around 1 sms per 6 sec) and you have to manage the "hosting" of the "SMS gateway". If you could afford, you might want to consider virtual SMS providers such as Nexmo and Hoiio API.
We are using smsapi.pl but so far there is only Polish support (it's gonna probably change quite soon). Maybe you should check this one - you'll find there https specification. They have also mail to sms interface.