devstepbcn/react-native-android-wifi

wifi.findAndConnect how do i listen to the response?

Closed this issue · 1 comments

Hey

so if i try to connect to a wifi network using wifi.findAndConnect ... the responso only tells me if it is in range not if i got connected ... how do i know if the connection succeeded?

Hey wowzaaa

Android doesn’t provide a callback when you try to connect to a wifi. You have to listen for connectivity changes to know if connection succeeded. You can use NetInfo from React Native Components.