Hi,
As Application.ExternalCall is getting deprecated in the latest beta, I need to redo client side code of my WebGL project. It uses Javascript to call the official Socket.io Javascript to connect to my server.
Apparently now the only way to call native Javascript is to do it through .jslib and I already ran into a problem in the beginning. I managed to call simple console log functions from my .js files converted to .jspre extension, but I get “exception thrown: ReferenceError: io is not defined” when trying to establish a connection with the help io Socket.io.js
I don’t have any deep level knowledge of Javascript, but I’m guessing the problem is somehow in the official socket.io.js file where the “io” usage is somehow “defined” right in the begining. It looks like this:
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["io"] = factory();
else
root["io"] = factory();
})(this, function() {
Is this a bug within Unity, some problem with .jspre extension, WebGL or something else? Everything was working just fine before when I had Socket.io.JS next to my WebGL project and I used it with some of my own Javascript with the help of Application.ExternalCall.