Connecting client to server in chat apps like Viber or Telegram
android, ios, web, websocket
Solution
Yes, this is the right approach. You will need to use websockets if you want to maintain a persistent connection with the server, which is essential to a chat app. You can try out using 3rd party libraries which offer webSocket functionality like SocketRocket(https://github.com/square/SocketRocket)
As an alternative, you can also try using a 3rd party chat SDK like Pepper Talk (https://github.com/Espreccino/PepperTalkSDK-iOS) which offers complete chat functionality including web sockets, notifications, UI etc out of box.
Disclaimer: I am co-founder of Pepper Talk.
Problem
I want to create an application like Viber or WhatsApp etc. My main challenge is connecting clients and server. Right now what i know that i have to use Websockets standard for connections. For web client i want to use standard Websockets and for Android and iOS i will use libraries for them based on Websockets. For example here you can see an example: http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-apps is this approach for this purpose is right? Whats other alternatives? For example Viber or Telegram how face this issue? Please help me to choose right approach before start. I will have 3 clients: Web, Android, iOS