Wampy not connecting in react-native env
See original GitHub issueDescribe the bug Wampy is not connecting properly in react-native environment.
The onConnect
callback is not called.
Killing the crossbar service will trigger the onClose
and onError
callbacks.
As mentioned also here: https://github.com/KSDaemon/wampy.js/issues/82#issuecomment-405012228
I also checked https://github.com/KSDaemon/wampy.js/issues/82 but could not find a working solution. Also the examples use w3cws
as ws client.
I made a stripped down version of crossbar.io without authentication and bundled it into a repo to reproduce.
To Reproduce
Clone https://github.com/zaytsevfuu/wampytest
yarn install
node node_modules/react-native/local-cli/cli.js run-android
yarn run start
cd crossbar && ./start_wamp.sh
Expected behavior
onConnect
callback is called
Screenshots
Environment (please complete the following information):
- Mac
- see package.json
- crossbar official docker image
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (11 by maintainers)
@cabelitos Thats great! Looking forward for next release with ur MR included 😃
@KSDaemon I did some more digging and I think the problem is just with react-native and android because of the OkHttp code. I don’t have mac handy to test on IOS right now, however this test should only check for the undefined protocol in RN envs, while not affecting other ones. The code below would replace 582 from the post above.
Apologies for the multi-line here, but I wanted to to fit in the post more easily.