简体   繁体   中英

Unable to connect to websocket

I have a cordova/phonegap app that is supposed to connect itself to a websocket server. It works fine on ios & android 4.4 but not on my Samsung Galaxy Tab 2 running android 4.2.

I know that the webview in 4.2 doesn't have a native implementation of WebSockets but I loaded a phonegap plugin for this. The plugin loads successfully and I waited for the deviceready event before attempting a connection. When I try the example provided by the plugin, the onerror event is trigered but I have no additionnal details.

Running the app using Google Chrome on the same device works, so I exclude a network issue. The application has the INTERNET permission. I'm a little out of clues at this point, any ideas are welcome :-)

Ok, after taking a look at the adb log as @Nicholas suggested (thanks!) I had an exec() call to unknown plugin . Somewhat following this answer solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM