(options = {})
| 14 | } |
| 15 | |
| 16 | const getNetworkType = function (options = {}) { |
| 17 | const { success, fail, complete } = options |
| 18 | NetInfo.fetch().then((connectionInfo) => { |
| 19 | const result = { |
| 20 | networkType: getConnectionType(connectionInfo), |
| 21 | errMsg: 'getNetworkType:ok' |
| 22 | } |
| 23 | defineUnsupportedProps(result, ['signalStrength', 'hasSystemProxy']) |
| 24 | successHandle(result, success, complete) |
| 25 | }).catch((err) => { |
| 26 | const result = { |
| 27 | errMsg: err.message |
| 28 | } |
| 29 | failHandle(result, fail, complete) |
| 30 | }) |
| 31 | } |
| 32 | |
| 33 | const onNetworkStatusChange = function (callback) { |
| 34 | _callbacks.add(callback) |
no test coverage detected