WeChat Mini Program API Network Status


wx.getNetworkType(OBJECT)


Get the network type.

OBJECT parameter description:

QQ截图20170208114201.png

wx.getNetworkType({
  success: function(res) {
    var networkType = res.networkType // 返回网络类型2g,3g,4g,wifi
  }
}
)