gcrabtree / react-native-socketio

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

Allow emit() to send a string on Android #17

Open davidperrenoud opened 8 years ago

davidperrenoud commented 8 years ago

Right now, emit() can send any object on iOS, but it can only send a Map on Android (a JSON object).

This pull request allows the emit() method on Android to send a string: socket.emit('some_event', 'a string')

Or a JSON object (as before): socket.emit('some_event', { some_key: 'some value' })

This is implemented on Android using two methods, one taking a String and the other taking a ReadableMap: https://facebook.github.io/react-native/docs/native-modules-android.html#argument-types