SocketRocket: In debug mode. Allowing connection to any root cert (react native iOS)
SocketRocket: In debug mode. Allowing connection to any root cert I am using socket.io in my react native project and socket connection process and its events are working fine on Android but at the same time, I am getting this above error while I tried to test on an iOS device.
Reproducable steps Install this package and run on iOS device and try to listen "connect" channel or any custom channel might be you will get the same error.
Socket.IO client version: 4.5.0
import {io} from 'socket.io-client';
const socket = io(config.API_BASE_URL, {
withCredentials: true,
extraHeaders: {
Cookie: cookies,
},
});
useMemo(() => {
socket.on('connect', () => {
checkConnection(socket.connected);
});
}, [socket]);
Expected behavior Socket.io should works as it is working fine for Android. It should get connected to "connect" channel or my custom channel.
Platform:
- Device: [iPhone real device e.g. iPhone 6s]
- OS: [OS 14.6]
Hi, @darrachequesne can you please help me out to get rid of this situation.
Try this: const socket = io(config.API_BASE_URL, { 'reconnection': true, 'reconnectionDelay': 50000, 'reconnectionDelayMax': 50000, 'reconnectionAttempts': 3, 'query': { apiKey: ‘APIKEY’, type: ‘Type’ }, transports: ['websocket'], });
@usmanabid94 that's not working for me. any other updates on this?
For future readers:
Please check our React Native guide here: https://socket.io/how-to/use-with-react-native
Please reopen if needed.