How to implement chat using bonjour service? - iphone

I have one application in which all available clients are displayed.Now i want
to implement chatting between them.can it be done with help of bonjour service without
having any other server in between them?any tutorial or sample code for that?

These links might be useful.
http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/
you can find source code on https://bitbucket.org/snej/chatty/src
thanks

Game Kit provides a high-level peer-to-peer connectivity API, which you can use for chat.

Related

Prebuilt UI for peer-to-peer chat?

I need to add a peer-to-peer live chat function to my website. I'd like to use a prebuilt UI that can integrate into my current website. Does anyone know how to do this?
If you are familiar with React, you can use https://github.com/chatscope/chat-ui-kit-react for UI together with https://github.com/chatscope/use-chat for connecting UI with your P2P communication layer.
It's not exactly prebuilt UI, but based on documentation you can make the chat UI very fast.
Disclaimer: I'm the author of both tools.

Communication between two iOS devices

I am looking for a way to have one iPhone app send a message to another app on a different phone (sort of like a Sender-Receiver set up). I am looking for the best possible way to do this. Does anyone have any ideas and/or tutorials?
Thanks for the help.
You should use GameKit. It is super easy to send messages between two iOS devices using it. Here's a great tutorial: Game Kit. You can also get more information about it here from the docs: About Game Kit.
You communicate by creating an ad-hoc bluetooth or local wireless network.
lmirak provided insightful info about device communication(especially about GameKit). I would like to add one more solution. You can use WiFi network to do your device communication.
See the link or download the sample application from developer.apple
The sample application named as WiTap. It demonstrates how to achieve network communication between applications. Using Bonjour, the application both advertises itself on the local network and displays a list of other instances of this application on the network.
If your app is only going to run on iOS, then you should use the fantastic MultipeerConnectivity library. https://developer.apple.com/documentation/multipeerconnectivity
If you need a solution that will work cross-platform, then one way to accomplish this is using sockets and connecting over a local network. On iOS you can use CocoaAsyncPods for sockets and NetService for discovery.
Here is a basic example app that does this: https://github.com/brendaninnis/LocalNetworkingApp
, which I explain in great detail here: http://brendaninnis.ca/connect-nearby-devices-part-1.html

How do chat iOS applications communicate?

How do text chatting in applications like Whatsapp and Skype communicate? Specifically, how are messages received real time?
Thanks in advance!
This is related with what is called Socket programming in iOS. you may refer to apple developer documentation for that or this link can help you regarding this.
Following links infact would be very helpful:
http://blog.scriptico.com/08/iphone-chat-native-rtmp-library-for-ios-in-action/
http://mobile.tutsplus.com/series/building-a-jabber-client-for-ios/
Whatsapp which uses XMPP also based upon socket programming.
Thanks

iPhone instant message app tutorial

I'm wondering if anyone knows of a place where I can get a tutorial on building a simple IM-style chat app between two iphones? Hopefully involving push notifications, though that's not as necessary.
Thanks!
I don't know of a tutorial, but you will need to use two things:
Socket Programming. - To establish connection between the devices, and transfer data through sockets.
NSNetService/NSNetServiceBrowser - To publish your services.
Google these 2, and you'll be good to go!

Types of Peer-to-peer connection

I am developing an application and trying to use an peer-to-peer communication. i have idea about bluetooth and WIFI.
Is their any other options for peer-to-peer communication. Is it possible using Internet option.
Please help me with a source code or any documentation?..
Check Apple's Documentation on the GameKit. That provides you exactly with what you are asking for.
WIFI is internet. I'm not quite sure what you mean.