gcrabtree/react-native-socketio

undefined is not an object (evaluating this.sockets.initialize)

Opened this issue · 8 comments

this.socket = new SocketIO('http://myserver.com:3000/', {secure: true}); this.socket.on('connect', () => { this.socket.emit('authentication', { token: this.state.valid, id_user: this.state.id });

I`m using react-native 0.42
getting this error just in iOs

jcrqr commented

Same on react-native@0.43.1 and react@16.0.0-alpha.6

Same issue trying with iOS, using react-native@0.42.3 and react@15.4.1.

Same here with react-native@0.43.1, any ideas why can this be?

Same here with react-native@0.44.2, who can solve this problem??

by my understanding, it means there is something wrong from xcode swift codes.
when i checked: let SocketIO = NativeModules.SocketIO; SocketIO is undefined
means somehow bridge from swift to objective-c is not working properly or it works but react native cannot bridge it to JS.
i still trying to make it work but so far couldn't find a cure :(

If NativeModules.SocketIO is undefined, check android step3 :
In MainApplication.java, modify getPackages,and compile new apk.

Any solutions here?