KoenLav / cordova-plugin-chrome-apps-sockets-tcp

Other
17 stars 16 forks source link

Issues w/ Ionic 3 #9

Closed rustygreen closed 4 years ago

rustygreen commented 6 years ago

I'm unable to get this plugin to work in Ionic 3. I'm doing the following steps:

// 1) Add plugin.
cordova plugin add cordova-plugin-chrome-apps-sockets-tcp

// 2) Use the plugin.
    this.platform.ready()
      .then((readySource) => {
        if (readySource == 'cordova') {
          // This will throw an error (chrome is undefined)
          (<any>window).chrome.tcp.socket.create();
        }
      });

I get "chrome" is not defined. Any suggestions?

KoenLav commented 6 years ago

I have little experience with Ionic.

I see in your forked repo you already managed to figure it out?

rustygreen commented 6 years ago

@KoenLav, it turns out that the problem was with IonicView - not the plugin. I didn't realize that IonicView only supports certain plugins: https://forum.ionicframework.com/t/tcp-requests-in-ionic-3/121490/12.