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

Added connectWithConfig. #41

Closed guptaamol closed 3 years ago

guptaamol commented 3 years ago

Added connectWithConfig to Specify 'groupOwnerIntent' to set Group Owner While Connecting.

kirillzyusko commented 3 years ago

Hi @guptaamol Could you please add some info about this method in README.MD?

guptaamol commented 3 years ago

@kirillzyusko I Have updated README.md please do take a look. Also there are some issues with respect to permissions for Android 10, one needs ACCESS_FINE_LOCATION instead of ACCESS_COARSE_LOCATION to make things work, i guess that needs to be a separate issue.

kirillzyusko commented 3 years ago

@guptaamol Thank you!

one needs ACCESS_FINE_LOCATION instead of ACCESS_COARSE_LOCATION to make things work

I think it's only Android 10 specific, because on Android 8 & 9 everything worked fine. In any case, thank you for pointing it out. As soon as you PR will be merged I'll change the info about permissions and will publish a new version.

guptaamol commented 3 years ago

Your right my bad 😅

On Mon, 14 Sep 2020, 13:37 Kirill Zyusko, notifications@github.com wrote:

@kirillzyusko requested changes on this pull request.

In README.MD https://github.com/kirillzyusko/react-native-wifi-p2p/pull/41#discussion_r487725732 :

@@ -223,6 +223,19 @@ connect('22:47:da:9d:58:83') .catch(err => console.error('Something gone wrong. Details: ', err));

+ +### connectWithConfig(connectionArgs) + +Connect to network. The method takes two arguments deviceAddress and an optional +groupOwnerIntent. groupOwnerIntent specifies to the OS the intentsity with which the device initiaiting the connection wants to be the group Owner.(i.e the server). It takes a value between 0 and 15, 0 and 15 being the least and most likely group owners respectively. i.e device specifying groupOwnerIntent 15 is more likely to be a group owner. +Link to andrdoid documentation [https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pConfig] + +```javascript +connect({ deviceAddress: '22:47:da:9d:58:83', groupOwnerIntent: 15 })

Shouldn't it be connectWithConfig ? :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kirillzyusko/react-native-wifi-p2p/pull/41#pullrequestreview-487512259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJREFM4W4BHWI3GPAZADOLSFXFK3ANCNFSM4RK2HMLA .

kirillzyusko commented 3 years ago

Published as 3.2.0