summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-07-28 14:29:12 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-07-28 21:21:31 -0700
commit807d87f0f5883e1c697433eca381c860a74596f2 (patch)
tree828f46754a0f26467552c58d676a779053f9151b /platform
parentd57a02f3a9274d331ddaa7a82d062e36fdc09251 (diff)
downloadqtlocation-mapboxgl-807d87f0f5883e1c697433eca381c860a74596f2.tar.gz
Ignore redundant initial reachability notification on iOS 9
Fixes #1911.
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/MGLMapView.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index afdc88cfca..e95305d0c6 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -106,6 +106,7 @@ CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)
mbgl::Map *_mbglMap;
MBGLView *_mbglView;
mbgl::DefaultFileSource *_mbglFileSource;
+ BOOL _isWaitingForRedundantReachableNotification;
NS_MUTABLE_ARRAY_OF(NSURL *) *_bundledStyleURLs;
@@ -244,6 +245,10 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
object:nil];
MGLReachability* reachability = [MGLReachability reachabilityForInternetConnection];
+ if ([reachability isReachable])
+ {
+ _isWaitingForRedundantReachableNotification = YES;
+ }
[reachability startNotifier];
// setup annotations
@@ -415,9 +420,11 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
- (void)reachabilityChanged:(NSNotification *)notification
{
MGLReachability *reachability = [notification object];
- if ([reachability isReachable]) {
+ if ( ! _isWaitingForRedundantReachableNotification && [reachability isReachable])
+ {
mbgl::NetworkStatus::Reachable();
}
+ _isWaitingForRedundantReachableNotification = NO;
}
- (void)dealloc