mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(connectivity): making startMonitoring() behave on iOS as on Android (#6373)
On Android, when calling startMonitor it will immediately fire the callback with the current state. Now it does the same on iOS.
This commit is contained in:
@@ -75,6 +75,7 @@ export function startMonitoring(connectionTypeChangedCallback: (newConnectionTyp
|
||||
_connectionTypeChangedCallback = <any>zonedCallback(connectionTypeChangedCallback);
|
||||
SCNetworkReachabilitySetCallback(_monitorReachabilityRef, _reachabilityCallbackFunctionRef, null);
|
||||
SCNetworkReachabilityScheduleWithRunLoop(_monitorReachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
_connectionTypeChangedCallback(_getConnectionType());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user