Open viniciuscb opened 1 year ago
Hi @kirillzyusko and @seba9999 . I've done this refactor, it is compiling and the whole lib is running.
However I could not do a basic test yet (sending and receiving file inside my app). If some of you can do this test, it would be good, if not, this will have to wait at least until next week.
@viniciuscb I quickly went through changes and overall it looks good 👍 I'm going to have a look over weekend on this again but I don't think I will find anything critical.
I'll try to test these changes, but it will be also not earlier than next week.
@viniciuscb any updates from your side? 👀
I got some time to test it...
But unfortunatlly I'm facing some errors on the sendMessage call :
it seems that wifiP2pInfo is null but I've tried calling getGroupInfo
before trying to send a message with no luck...
Just to be sure ... Your new parameter {meta: true}
could only be used after the first successful sendMessage to the groupOwner because he is the only address we know already right ?
Then we should store other devices addresses on our own to then be able to sendMessageTo
them ?
sendMessage
Hi @seba9999 .
{meta: true}
can be used every time. It will display the origin IP. It is used in receiveMessage(): receiveMessage({meta: true})
Yes, we have to store the senders by our own.
I'll test this file sending method this week. Besides that, I think that we could update the examples.
@viniciuscb any updates? 👀
@kirillzyusko can you merge and release those changes please ? With Expo I'm unable to test this new code until you make a new release 😢
@seba9999 I can not publish a release which potentially can be broken. You can use this PR/branch to install dependency with this code 🙂
Yep sorry nevermind since then I was able to try and I've sucessfully sendMessage
to the groupOwner and then one message back to the sender with the sendMessageTo
with the address in the message object returned ! 🎆 🥳
Works great ! Feel free to publish the next version then ;)
( I didn't test the senFile / receiveFile )
@seba9999 okay, I will publish new version soon!
P. S. published!
a new optional parameter has been added to the receiveFile method. If receiveFile receives an object {meta: true}, then the promise result is not a string, but an object with the following format:
{ fromAddress: "", file: "file absolute path (string)" }