Network Status
Back

From WeChat Official Account Admin Platform
Jump to: navigation, search

To provide different quality levels of service according to the user's network status, developers can obtain the network status via a section of JavaScript code in the web pages of the official account.

API Calling Code (JavaScript)

WeixinJSBridge.invoke('getNetworkType',{}, 
 		function(e){ 
	    	WeixinJSBridge.log(e.err_msg);
	    });

Return Description

network_type:wifi WiFi
network_type:edge 3G/2G
network_type:fail Offline
Developer Guide
Custom-defined Menu
WeChat JS-SDK