Open BigPun86 opened 8 years ago
+1
I'll take a look sometime tonight.
I haven't upgraded support to RN 0.28 as the project we are working on had major issues with that release (outside of this library). We are currently running on RN 0.25.1.
Will keep you posted.
Yeah, there are breaking API changes between those two releases (RN 0.25 and RN 0.28). That would explain the deprecation warnings. I will migrate those to the new RCTEventEmitter class in a new release that supports 28+. They should probably still work in RN 28, but I'll need to update them moving forward.
@BigPun86 or @mcliquid WRT the undefined error, how are you importing socketio? I need to re-read the documentation that I have. The previous project (that appears to be dead) that I forked this from (spiritually, not an actual fork), had that original ios example. It's likely not working so I'll need to fix that up as well.
For now, this is how I include socketio and have it working on RN 25:
let io = require('react-native-socketio');
let socket = new io(url, socketioOptions);
socket.connect();
Let me know if that gets you past the undefined problem.
There are a few issues with the packager with RN 28. https://github.com/facebook/react-native/issues/8297 https://github.com/facebook/react-native/issues/8409
I can confirm this is broken with the latest RN (0.32). Does anyone have a fix?
In the meantime, I'd suggest a big warning on the README so people don't waste their time.
I am getting the this.socket undefined with react native 0.35
I am getting the this.socket undefined with react native 0.31
I am getting the this.socket undefined with react native 0.37.0
I am getting the this.socket undefined with react native 0.37.0
Answer: I forgot change getPackages on MainApplication.java
README.md 3.Register module (in MainActivity.java) is error!!! is should change to: 3.Register module (in MainApplication.java) @gcrabtree hope help
i'm getting this issue in react-native 0.42 in iOS only
The same. Error on iOS I tried 0.39.2, 0.40.0, 0.41.0, 0.42.3 and this bug still exist.
TypeError: Cannot read property 'initialize' of undefined at new Socket (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:68738:13) at GameLobby.createLobbySocket (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:69173:12) at GameLobby.componentWillMount (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:69040:37) at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:19500:24 at measureLifeCyclePerf (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:19117:8) at ReactCompositeComponentWrapper.performInitialMount (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:19499:1) at ReactCompositeComponentWrapper.mountComponent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:19378:13) at Object.mountComponent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:17462:29) at Object.obj.(anonymous function) [as mountComponent] (eval at initialize (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:34422:1),
:1217:27) at Constructor.mountChildren (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:18389:32)
who can fix this problem???
+1
any update on this issue???
@gogulanareshkw no.
Is there really a need to still be using this library? If you're running the latest RN version you can just use socket.io-client without any issue.
yarn add socket.io-client
import SocketIOClient from 'socket.io-client';
const socket = new SocketIOClient('your_domain', {
transports: ['websocket']
});
socket.connect();
socket.on('connect', () => {
console.log('connected!');
});
I notified when integrating this module to my xcode project, it gives me some warnings:
Did anyone experience similar issue?
Running on RN 28 and testing with your example code