Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a58fc52

Browse files
surduAlexander Vakrilov
authored andcommitted
fix(connectivity): making startMonitoring() behave on iOS as on Android (NativeScript#6373)
On Android, when calling startMonitor it will immediately fire the callback with the current state. Now it does the same on iOS.
1 parent a211bbd commit a58fc52

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tns-core-modules/connectivity/connectivity.ios.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export function startMonitoring(connectionTypeChangedCallback: (newConnectionTyp
7575
_connectionTypeChangedCallback = <any>zonedCallback(connectionTypeChangedCallback);
7676
SCNetworkReachabilitySetCallback(_monitorReachabilityRef, _reachabilityCallbackFunctionRef, null);
7777
SCNetworkReachabilityScheduleWithRunLoop(_monitorReachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
78+
_connectionTypeChangedCallback(_getConnectionType());
7879
}
7980
}
8081

0 commit comments

Comments
 (0)