Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidperrenoud
Copy link

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

@davidperrenoud davidperrenoud mentioned this pull request Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant