gcrabtree / react-native-socketio

Not Maintained! A React Native wrapper for both the Swift and Java Socket.Io clients.
MIT License
152 stars 53 forks source link

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

Open LucasSouzaa opened 7 years ago

LucasSouzaa commented 7 years ago

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 7 years ago

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

ginniecodes commented 7 years ago

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

juboba commented 7 years ago

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

atlas1119 commented 7 years ago

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

blackavec commented 7 years ago

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 :(

jose920405 commented 7 years ago

+1

zhangsir199 commented 6 years ago

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

ArturGr commented 6 years ago

Any solutions here?