Thanks @sdetweil, do I need to manually import any JS code? All I did was the following steps. I’m guessing I missed something:
// 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();
}
});
Do I need to include any JS code from plugin? I assumed it automatically got added but I’m not familiar enough with Cordova to understand the whole process.
Hmm…strange - I wonder if this is a problem with Ionic pro build then. Even with those changes I still get the an error (window.chrome.sockets is undefined). I am building it through Ionic Pro and then distributing it to my iPad using Ionic View.
@sdetweil, if you have a chance could you try running the app in Ionic View? The App ID is: fa29551e
Here’s the error I get with the changes you recommended applied:
Thanks @sdetweil and @Tommertom, I did not realize their was a limitation on plugin usage in Ionic View. Does anyone know why their is a limitation? Or if that will change? I would like to use Ionic View, but it’s looking like that may not be an option?