简体   繁体   中英

How to connect to an SSID from an app built with Expo and React Native?

I want my app to be able to connect to a Wifi network whose SSID and password are already gonna be hardcoded in the app. Hope there is a way to do this in expo. I know I could use something like https://www.npmjs.com/package/react-native-wifi-reborn but probably do not want to eject out of expo.

Answering my own question here for anyone who's facing the same problem. With the latest Expo updates now we can add react-native packages to the managed expo workflow without ever ejecting. What that means is we can install https://www.npmjs.com/package/react-native-wifi-reborn to our Expo project.

We'll just be needing to install expo-dev-client to our project and then use EAS build. Consider reading this guide know the exact steps needed https://docs.expo.dev/development/getting-started/

I'm also planning to write a blog post around this, will update here as soon as it gets finished :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM