0

i'm using kaazing javascript jms library to establish a connection in our angular/cordova hybrid app. for the first time everyting works fine. then i kill the application and try to connect again. it just hangs and nevers calls the callback after createConnection:

  var future = factory.createConnection(function () { ..//do some stuff ... })

When I set the log-level to trace

 Tracer.setTrace(true); 

I can see the following exception in chrome developer tools:

DF5963E0C7FF945789FBBD2CCD142D2F.cache.js:692 Uncaught Application Exception: com.google.gwt.core.client.JavaScriptException: (TypeError) : $wnd.Connection is not a function

Did somebody experience the same?

Thanks Angela

faenschi
  • 271
  • 1
  • 3
  • 11
  • Hello @puzste, can you confirm you are calling createConenction inside a "deviceready" listener. "document.addEventListener("deviceready", yourCallbackFunction, false);" – hthetiot May 25 '17 at 18:37
  • Hello @hthetiot. I tried both, it doesn't matter if the create Connection is called from deviceready or not. The second time i start the application the calleback is never called...regards – faenschi May 29 '17 at 07:14
  • Finally we solved the problem! The kaazing library had a name clash with the cordova plugin cordova-plugin-network-information which is a transitive dependency of phonegap-plugin-mobile-accessibility which we’re using. The Connection object of the kaazing library is globally exposed ($wnd.Connection). The same name is used by cordova-plugin-network-information. To circumvent this, we replaced the variable Connection with KaazingConnection in the file DF5963E0C7FF945789FBBD2CCD142D2F.cache.js. I think kaazing should fix this! – faenschi Jun 20 '17 at 14:20

0 Answers0