iOS chat APNS, sockets or time interval [closed]

吃可爱长大的小学妹 提交于 2019-12-02 20:28:14

I think your main concern is how to receive new messages while your application is in the background. Because it's not like I'm going to have a messenger app all day open when I can get notifications with apps like WhatsApp.

Better than TCPIP sockets you could use websockets. Since it is HTTP there are no firewall problems, BUT that requires a permanent connection with application on the foreground which drains the battery.

And because only music, location, or voice ip, is allowed to run on the background, you can't poll unless the application is open. Note that if you register for those background tasks and do something else Apple will notice and reject your app.

Therefore, use APNS. That's what WhatsApp does.

Use XMPP SERVER for chat purpose

http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-xmpp-integration/

I hope this link will be useful to you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!