-
Notifications
You must be signed in to change notification settings - Fork 111
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
Sending a buffer's value from node js side #17
Comments
Hi, haven't tried passing a Buffer yet. What platform are you on? In the react-native plugin, what is sent will be converted to JSON and back when it is passed through the bridge. This article might be helpful in understanding what happens to a Buffer when converted to JSON: https://hackernoon.com/https-medium-com-amanhimself-converting-a-buffer-to-json-and-utf8-strings-in-nodejs-2150b1e3de57 Hope this is helpful. |
That was very helpful, my problem is solved.
|
Hi @WijdanMTak , |
`[3/3] Linking CXX shared library ........\build\intermediates\cmake\debug\obj
FAILURE: Build failed with an exception.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. BUILD FAILED in 2m 41s Hope that describes the error, sorry for my lack of knowledge. |
Hi @WijdanMTak , Regarding the I'm currently trying to see if there's something I might be able to do inside the plugin to fix it, but from the application side you can tell gradle to pick the first it finds, since they'll be the same. Inside
Regarding the trace error, what are you talking about? |
Thanks for your response,but unfortunately, that doesn't solve the problem and leads to the previous error (Duplicate module name Error):
what should I do? |
The duplicate module name issue can be solved by following these steps from the The newest versions of Regarding the |
Thanks! that solved my problem. ^_^ |
I'm receiving a value in a buffer(2) and I used the readInt16BE() to read It as integer.
for example:
console.log(buf); //Buffer<00 02>
console.log(buf.readInt16BE()); // 2
but when I'm trying to send it to react-native side the received value will be:
alert("from node:"+msg);// from node:0
I've tried many convert ways, Like: "toString(),ParseInt(),and also Number()", but it doesn't work.
is the problem from the way to convert the buffer or the technique in sending it?
The text was updated successfully, but these errors were encountered: