React Native Crash upon calling dataChannel.send
See original GitHub issueAfter receiving the the open event for a created data channel, attempting to send always crashes the react native app and brings up the red box with the following stack trace
java.lang.Double cannot be converted to java.lang.String getString:102, ReadableNativeArray (com.facebook.react.bridge) extractArgument:73, JavaMethodWrapper$5 (com.facebook.react.bridge) extractArgument:69, JavaMethodWrapper$5 (com.facebook.react.bridge) invoke:356, JavaMethodWrapper (com.facebook.react.bridge) invoke:151, JavaModuleWrapper (com.facebook.react.bridge) run:-1, NativeRunnable (com.facebook.react.bridge.queue) handleCallback:938, Handler (android.os) dispatchMessage:99, Handler (android.os) dispatchMessage:27, MessageQueueThreadHandler (com.facebook.react.bridge.queue) loop:246, Looper (android.os) run:226, MessageQueueThreadImpl$4 (com.facebook.react.bridge.queue) run:923, Thread (java.lang)
Expected behavior
Data channel sends message to peer.
Observed behavior
Crash and exception above
Steps to reproduce the problem
Create a data channel and attempt to send string message
Platform information
- React Native version:
- 0.63.4
- Plugin version:
1.89.31.89.1- OS:
- Android
- OS version:
- Android 11
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
I retested it today with a clean environment and confirmed that the id parameter doesn’t matter for 1.89.3. What likely happened was that I had 1.89.1 still cached (this was only other version I’ve used of this plugin). I’ve updated the initial report to reflect that. Thanks for investigating and apologies for the trouble.
can you please share code for data channel as I am unable to do that