mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 17:13:46 +08:00
Fix NetInfo for Android
Reviewed By: oli Differential Revision: D2708102 fb-gh-sync-id: f6a12c49c89c46d31114fefaf3e2b1ba72dabdee
This commit is contained in:
committed by
facebook-github-bot-8
parent
b828ae4200
commit
cf892a96d6
@@ -17,7 +17,7 @@ var Platform = require('Platform');
|
||||
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
|
||||
var RCTNetInfo = NativeModules.NetInfo;
|
||||
|
||||
var DEVICE_REACHABILITY_EVENT = 'networkDidChange';
|
||||
var DEVICE_REACHABILITY_EVENT = 'reachabilityDidChange';
|
||||
|
||||
type ChangeEventName = $Enum<{
|
||||
change: string;
|
||||
@@ -163,7 +163,7 @@ var NetInfo = {
|
||||
var listener = RCTDeviceEventEmitter.addListener(
|
||||
DEVICE_REACHABILITY_EVENT,
|
||||
(appStateData) => {
|
||||
handler(appStateData.network_info);
|
||||
handler(appStateData.network_reachability);
|
||||
}
|
||||
);
|
||||
_subscriptions.set(handler, listener);
|
||||
|
||||
Reference in New Issue
Block a user