getConnectedWifi 在IOS上返回异常fail no wifi is connecte
问题:在多个IOS设备上.getConnectedWifi返回异常
代码片段
wx.startWifi({
success (res) {
console.log(res)
}
});
wx.getConnectedWifi({
success: function(res) {
console.log(res,"WIFI链接成功");
},
fail: function(res) {
console.log(res,"WIFI链接失败");
}
});
wx.getNetworkType({success(res){console.log(res,"网络类型")}})
wx.getSystemInfo({success(res){console.log(res,"系统信息")}})
输出结果依次是
{"errMsg":"startWifi:ok"}
{errMsg: "getConnectedWifi:fail no wifi is connected."} "WIFI链接失败"
{errMsg: "getNetworkType:ok", networkType: "wifi"} "网络类型"
{"benchmarkLevel":10,"language":"zh_CN","wifiEnabled":true,"safeArea":{"bottom":736,"height":716,"top":20,"width":414,"left":0,"right":414},"bluetoothEnabled":true,"locationAuthorized":false,"deviceOrientation":"portrait","notificationSoundAuthorized":true,"screenHeight":736,"windowHeight":624,"system":"iOS 13.6","version":"7.0.18","locationReducedAccuracy":false,"statusBarHeight":20,"fontSizeSetting":17,"pixelRatio":3,"windowWidth":414,"notificationAuthorized":true,"notificationBadgeAuthorized":true,"errMsg":"getSystemInfo:ok","locationEnabled":true,"batteryLevel":100,"model":"iPhone 6s Plus","screenWidth":414,"screenTop":64,"microphoneAuthorized":true,"albumAuthorized":true,"cameraAuthorized":true,"notificationAlertAuthorized":true,"brand":"iPhone","platform":"ios","SDKVersion":"2.14.1","host":{"env":"WeChat","appId":"","version":385880627}}
关键信息:
手机型号:iphone 6S Plus 操作系统__.IOS 13.6__ 微信版本__7.0.18__ 小程序SDK版本__2.41.1__
测试环境:IOS设备->真机调试->命令行执行
网络环境为公司WIFI 稳定性一般. 2.4G频段
操作时间 2021年1月14日 18:27分左右 前后误差十分钟.
多个设备测试均出现以上问题.