我一直在考慮爲舊的Android 2手機整合Android websocket插件https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket,但是當我嘗試爲PhoneGap Build編寫plugin.xml文件時,我遇到了障礙。如何爲Phonegap Build Websocket編寫plugin.xml文件?
歸結爲:我如何包含這一行代碼?
java WebSocketFactory wsFactory = new WebSocketFactory(appView); appView.addJavascriptInterface(wsFactory, "WebSocketFactory");
這是插件運行的要求(根據GitHub)。感謝您的幫助!
背景:這裏有一個關於構建插件https://build.phonegap.com/docs/plugins和樣本插件文件https://github.com/alunny/pluginstall/blob/master/test/plugin/plugin.xml