title: React Native socket.io client connecting successfully, but emits are not received on either end
body: <p>I'm trying to get communication working between a socket-io server and an iOS app. The devices connect according to both logs, but any <code>socket.emit()</code> actions from either the client or the server are not triggering the respective <code>.on()</code> event on the other end. Here is a minimal example that produces this problem.</p>
  
  <p>Server code:</p>
  
  <pre><code>from aiohttp import web
  import socketio
  
  sio = socketio.AsyncServer()
  app = web.Application()
  sio.attach(app)
  
  @sio.on('connect', namespace='/mp')
  async def connect(sid, environ):
      print("connect ", sid)
  
  @sio.on('chat message', namespace='/mp')
  async def message(sid, data):
      print("message ", data)
  
  @sio.on('disconnect', namespace='/mp')
  def disconnect(sid):
      print('disconnect ', sid)
  
  if __name__ == '__main__':
      web.run_app(app)
  </code></pre>
  
  <p>Client code (React Native app)</p>
  
  <pre><code>window.navigator.userAgent = 'ReactNative';
  import React from "react"
  import openSocket from "socket.io-client"
  import { StyleSheet, Text, View, FlatList } from "react-native"
  console.ignoredYellowBox = ["Remote debugger"]
  import { YellowBox } from "react-native"
  YellowBox.ignoreWarnings([
      "Unrecognized WebSocket connection option(s) `agent`, `perMessageDeflate`, `pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`. Did you mean to put these under `headers`?"
  ])
  var app = null
  var socket = openSocket("http://localhost:8080/mp", {
              jsonp: false,
              reconnection: true,
              reconnectionDelay: 500,
              reconnectionAttempts: Infinity,
              transports: ["websocket"]
          })
  
  export default class App extends React.Component {
      constructor(props) {
          super(props)
          app = this
  
          socket.on("connect", function() {
              console.log("connected")
              socket.emit("message", "test")
          })
  
      }
  
      render() {
          app = this
          return (
              &lt;View style={styles.container}&gt;
                  &lt;Text&gt;Open up App.js to start working on your app!&lt;/Text&gt;
              &lt;/View&gt;
          )
      }
  }
  
  const styles = StyleSheet.create({
      container: {
          flex: 1,
          backgroundColor: "#fff",
          marginLeft:20,
          marginTop: 40,
      }
  })
  </code></pre>