kirillzyusko / react-native-wifi-p2p

Library that provide access for working with wi-fi direct (p2p) module in android.
164 stars 32 forks source link

receiveFile refactor #82

Open viniciuscb opened 1 year ago

viniciuscb commented 1 year ago
viniciuscb commented 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.

kirillzyusko commented 1 year ago

@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.

kirillzyusko commented 1 year ago

@viniciuscb any updates from your side? 👀

seba9999 commented 1 year ago

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 ?

viniciuscb commented 1 year ago

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.

kirillzyusko commented 1 year ago

@viniciuscb any updates? 👀

seba9999 commented 1 year ago

@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 😢

kirillzyusko commented 1 year ago

@seba9999 I can not publish a release which potentially can be broken. You can use this PR/branch to install dependency with this code 🙂

seba9999 commented 1 year ago

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 )

kirillzyusko commented 1 year ago

@seba9999 okay, I will publish new version soon!

P. S. published!