Currently, the Mobile SDK's sendData() operation is not interoperable with the WebSDK. Due to the differing Data Channel protocol versions, sendData() is only compatible between the Mobile SDKs.
If you need to send small chunks of data real-time (in a way that needs to be responded to immediately) programmatically rather than by user action from the Mobile SDK to the Web SDK, you can try the following method:
- Sending SDK encodes data chunk as a base64 encoded string.
- The string is sent using a P2P message sending method (e.g. sendP2PMessage on Android) to the other SDK.
- The receiving SDK decodes the base 64 encoded string back into the original data chunk.
You may also wish to refer to these Java and Javascript examples on how to encode and decode a data chunk to and from a string.