How to connect the mini program to WIFI
This article mainly introduces the WeChat applet to realize the WiFi connection function, and analyzes the module initialization, configuration, connection and other related operation skills of the WeChat applet to operate WiFi connection in the form of examples. Friends in need can refer to the following
How to connect to WIFI with a small program
When the wifi account and wifi password are known, the following process is generally used to connect to wifi.
Recommended learning: Small program developmentTutorial
Wi-Fi interface call:
1, Android
startWifi —> connectWifi —> onWifiConnected
2. iOS (only supported by iOS 11 and above):
startWifi —> connectWifi —> onWifiConnected
The steps are as follows:
1. Get the model number of the phone:
connectWifi:function() { var that = this; //检测手机型号 wx.getSystemInfo({ success: function(res) { var system = ''; if (res.platform == 'android') system = parseInt(res.system.substr(8)); if (res.platform == 'ios') system = parseInt(res.system.substr(4)); if (res.platform == 'android' && system < 6) { wx.showToast({ title: '手机版本不支持', }) return } if (res.platform == 'ios' && system < 11.2) { wx.showToast({ title: '手机版本不支持', }) return } //2.初始化 Wi-Fi 模块 that.startWifi(); } }) }, //初始化 Wi-Fi 模块 startWifi: function() { var that=this wx.startWifi({ success: function() { //请求成功连接Wifi that.Connected(); }, fail: function(res) { this.setData({ wx.showToast({ title: '接口调用失败', }) }); } }) },
2. Connect to known Wifi
Connected: function() { var that=this wx.connectWifi({ SSID: that.data.accountNumber, BSSID: that.data.bssid, password: that.data.password, success: function(res) { wx.showToast({ title: 'wifi连接成功', }) }, fail: function(res) { wx.showToast({ title: 'wifi连接失败', }) } }) }, //使用的参数 data:{ accountNumber: '',//Wi-Fi 的SSID,即账号 bssid: '',//Wi-Fi 的ISSID password: '',//Wi-Fi 的密码 }
3. .wxml connection button
<button bindtap="connectWifi"></button>
PHP Chinese website , a large number of MySQL video tutorials, welcome to learn online for free!
The above is the detailed content of How to connect the mini program to WIFI. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Are you curious about how to connect Xiaoai speakers to wifi? Xiaoai Speaker is a very comprehensive smart speaker software. Users can control and configure your AI speaker on their mobile phones, such as adjusting volume, playing music, voice wake-up, etc. Are there any friends who are using it for the first time and don’t know how to set up the wifi connection of Xiaoai speakers? The editor has now compiled the detailed steps for connecting Xiaoai speakers to the wifi network to share with you! If it is helpful to you, please download the software and experience it! 1. How to connect Xiaoai speakers to wifi? Detailed steps for connecting Xiaoai speakers to wifi network! 1. Open the latest version of Xiaoai Speaker app downloaded from this site. The latest version of Xiaoai Speaker app Category: Convenient life Download the latest version of Xiaoai Speaker app is a very convenient smart home service software that can

In fact, it is LAN printer sharing. The method is as follows: 1. Set the IP for the printer. First, plug the network from the router or switch to the printer. 2. Then click Printer Settings - Network Configuration - Wireless Menu. It is best to set a fixed IP for the printer there. Next, download and install the printer driver on your computer. When installing the driver, select the network installation option, so that the computer will automatically search for printers connected to the shared network. Once the installation is complete, the driver will show that the printer has been successfully shared wirelessly. How to connect the printer through a wireless network: 1. Right-click the WiFi icon under the desktop and select "Open Network and Sharing Center". 2. Click the name of the WiFi you are connected to, and a pop-up will appear.

With the popularity of mobile Internet technology and smartphones, WeChat has become an indispensable application in people's lives. WeChat mini programs allow people to directly use mini programs to solve some simple needs without downloading and installing applications. This article will introduce how to use Python to develop WeChat applet. 1. Preparation Before using Python to develop WeChat applet, you need to install the relevant Python library. It is recommended to use the two libraries wxpy and itchat here. wxpy is a WeChat machine

Mini programs can use react. How to use it: 1. Implement a renderer based on "react-reconciler" and generate a DSL; 2. Create a mini program component to parse and render DSL; 3. Install npm and execute the developer Build npm in the tool; 4. Introduce the package into your own page, and then use the API to complete the development.

Implementing card flipping effects in WeChat mini programs In WeChat mini programs, implementing card flipping effects is a common animation effect that can improve user experience and the attractiveness of interface interactions. The following will introduce in detail how to implement the special effect of card flipping in the WeChat applet and provide relevant code examples. First, you need to define two card elements in the page layout file of the mini program, one for displaying the front content and one for displaying the back content. The specific sample code is as follows: <!--index.wxml-->&l

1. Plug in the Xiaoai speaker and turn it on. 2. Log in to the Xiaoai Speaker APP with your mobile phone and automatically search for your speakers. 3. Click to start network configuration, select WiFi, enter the password, and click to connect.

I believe everyone is familiar with Xiaoai. It has brought us a lot of convenience and happiness in life, and many friends will not be unable to connect to the Internet for a long time when they are busy. Let's demonstrate it in a simple and convenient way. If your phone is of the Xiaomi brand, you only need to open the settings, find Xiaoai classmates, and click Check for Updates. If your phone is of another brand, you need to download the Xiaoai Audio APP. Then open and click on me in the lower right corner. Click Upgrade. As shown in Figure 3, click Detect Updates. If you still cannot connect to the network, try restarting the router. Xiaoai speakers support connecting to wireless networks (Wi-Fi), and some models also support 5G frequency bands. The steps for connecting Xiaoai speakers to Wi-Fi are as follows: Step 1: Plug in the power adapter of the newly purchased Xiaoai speaker and turn it on.

According to news from this site on October 31, on May 27 this year, Ant Group announced the launch of the "Chinese Character Picking Project", and recently ushered in new progress: Alipay launched the "Chinese Character Picking-Uncommon Characters" mini program to collect collections from the society Rare characters supplement the rare character library and provide different input experiences for rare characters to help improve the rare character input method in Alipay. Currently, users can enter the "Uncommon Characters" applet by searching for keywords such as "Chinese character pick-up" and "rare characters". In the mini program, users can submit pictures of rare characters that have not been recognized and entered by the system. After confirmation, Alipay engineers will make additional entries into the font library. This website noticed that users can also experience the latest word-splitting input method in the mini program. This input method is designed for rare words with unclear pronunciation. User dismantling
