Closed ForamPattha closed 1 year ago
@ForamPattha please, attach logcat
output just for period of time when you've tried to perform your actions. I can't help just based on the code you've attached 😔
@kirillzyusko can you please check this attach ss .
You can also see that in native file I also got empty array.
@ForamPattha You've attached logs only for 100ms... Can you attach from time when you initialize module till the time when it returns an empty array?
const initialiseP2P = async () => { const init = await initialize() console.log('In initialiseP2P', init); // since it's required in Android >= 6.0 const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, { title: 'Access to wi-fi P2P mode', message: 'ACCESS_FINE_LOCATION', }, ); if (granted === PermissionsAndroid.RESULTS.GRANTED) { onStartDiscoveringPeers() } else { Alert.alert('Warning', 'Permission denied: p2p mode will not work') } };
const onStartDiscoveringPeers = async () => { await startDiscoveringPeers() .then(() => getAvailablePeers()) .then(({devices}) => console.log('Available Devices:', devices),
); };
Use above code but not getting near by device list ..I have tested this with 2 to 3 android device which Android version is 10 or up. There is no error log in logcat . Any help would be appreciated...thanks in advance.