android - NetInfo.getConnectionInfo() 为 android 返回未知
问题描述
我正在使用以下代码获取连接信息,但它返回未知的 android:
componentDidMount() {
NetInfo.getConnectionInfo().then(connectionInfo => {
console.log("Connection type", connectionInfo.type);
console.log("Connection effective type", connectionInfo.effectiveType);
});}
我正在使用react-native-netinfo包来获取连接信息。
反应原生版本:0.59.0
解决方案
推荐阅读
- sql - 根据键提取行
- wordpress - WordPress + woommerce。更新不在导入文件中的物料的库存数量
- python - Jupyter Notebook 无法访问 conda 环境包
- c++ - 我不能使用全局类向量
- php - 必须使用“set”方法更新发生数据库错误
- micropython - micropython 1.9.4 Casio fx-CG50 NameError: reversed is not defined 错误
- node.js - 请帮助,部署 MERN 电子商务进行生产的最佳/有效方式
- swiftui - SwiftUI + SpriteView = 灰屏
- three.js - 从 CSG 获取 Threejs 面孔
- python - 从 Websocket 服务器流式传输对象数据,而不是在每次迭代时提取整个字典