ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.34k stars 411 forks source link

How can we pass string data(parameter) between two clients? #43

Open adarshvcdev opened 8 years ago

adarshvcdev commented 8 years ago

How can we pass string data(parameter) between two clients? Is this achieved by RTCDataChannel?

GaelHLago commented 8 years ago

use a JSON ? { "data": "parameter", "timestamp": "YourTimestamp" }

And just use DataChannel to send the json

adarshvcdev commented 8 years ago

Is there any DataChannel implementation or sample code or documentation for RTCDataChannel implementation?

hengtelin commented 8 years ago

hey, I'm new to this repo. So do I need DataChannel if I just need to send a command(used to control a mini car)?

GaelHLago commented 8 years ago

WebRTC doesn't provide signaling, so you probably use WebSocket, XMPP or any signaling protocol. You can send datas from those channels without using datachannels. Integrating DataChannel isn't so hard, you just have to set the delegate and understand what is a DataChannel for webrtc (check https://developer.mozilla.org/fr/docs/Web/API/RTCDataChannel)

BenjaminFaal commented 8 years ago

Hello, i made a pull request for this: https://github.com/ISBX/apprtc-ios/pull/45

hjh006 commented 8 years ago

you may use websocket and send a Json