From a58fc528b2dcd9fa77218e8f292be14dc10ed020 Mon Sep 17 00:00:00 2001 From: Nicu Date: Tue, 23 Oct 2018 00:06:39 +0300 Subject: [PATCH] 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. --- tns-core-modules/connectivity/connectivity.ios.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tns-core-modules/connectivity/connectivity.ios.ts b/tns-core-modules/connectivity/connectivity.ios.ts index da9848437..a0fb89455 100644 --- a/tns-core-modules/connectivity/connectivity.ios.ts +++ b/tns-core-modules/connectivity/connectivity.ios.ts @@ -75,6 +75,7 @@ export function startMonitoring(connectionTypeChangedCallback: (newConnectionTyp _connectionTypeChangedCallback = zonedCallback(connectionTypeChangedCallback); SCNetworkReachabilitySetCallback(_monitorReachabilityRef, _reachabilityCallbackFunctionRef, null); SCNetworkReachabilityScheduleWithRunLoop(_monitorReachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + _connectionTypeChangedCallback(_getConnectionType()); } }