Tlantic / cdv-socket-plugin

Cordova Socket Plugin
GNU General Public License v3.0
51 stars 43 forks source link

Uncaught TypeError: Cannot read property 'plugins' of undefined #75

Open guardian2011 opened 9 years ago

guardian2011 commented 9 years ago

All the other methods are working fine, but the foillowing code:

 document.addEventListener(window.tlantic.plugins.socket.receiveHookName, function (ev) {
   console.log(ev.metadata.host);    // host who sent the data
   console.log(ev.metadata.port);    // sender port
   console.log(ev.metadata.id);      // connection id
   console.log(ev.metadata.data);    // received data
 });

returns:

 Uncaught TypeError: Cannot read property 'plugins' of undefined