I have a small app that users pusher, is built with Sencha Touch 2, wrapped in phonegap (cordova 1.7.0) and packaged for android. Pusher has a flash fallback for non-webocket support.
per http://pusher.tenderapp.com/kb/faq/does-pusher-work-with-phonegap-yes I added this to my .java file:
super.init();
this.appView.getSettings().setPluginsEnabled(true);
It seems it is trying to load flash, but I see this in logcat when running on my device:
06-28 16:41:53.559: D/CordovaLog(16269): WARNING: web-socket-js doesn’t work in file:///… URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://…
06-28 16:41:53.559: D/CordovaLog(16269): https://yadayada.cloudfront.net/1.11.2/flashfallback.min.js: Line 52 : WARNING: web-socket-js doesn’t work in file:///… URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://…
Feels like I am close, but am missing the last bit to get this wired up.
Thanks for any insight.
There’s now a starter project to help out with this. It means that Flash fallback isn’t required and instead a native Java WebSocket library is used and exposed to the JavaScript runtime in the WebView.
Here’s a blog post about it:
http://blog.pusher.com/2012/7/5/pusher-on-phonegap-for-android
Here’s the starter Pusher, PhoneGap and Android project:
https://github.com/pusher/pusher-phonegap-android