diff options
author | Jason Wray <jason@kulturny.com> | 2015-12-02 17:36:09 -0500 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2015-12-03 11:13:28 -0800 |
commit | f67ceec8c24d58dc2c976db8b1c2d0a3e8a68efc (patch) | |
tree | faf829828b267b357e0d06c57edb270a72feeb71 | |
parent | e2921f7e7c9d86d6abdca41443dd79bd0089a74e (diff) | |
download | qtlocation-mapboxgl-f67ceec8c24d58dc2c976db8b1c2d0a3e8a68efc.tar.gz |
[ios] fix CoreTelephony crash (by removing it)
Fix #3112, ref #2581
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | docs/BUILD_IOS_OSX.md | 1 | ||||
-rw-r--r-- | platform/ios/MGLMapboxEvents.m | 45 |
3 files changed, 2 insertions, 46 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7cf25bee4f..5d549c3bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ Known issues: ## iOS master +- Fixed CoreTelephony.framework crash. ([#3170](https://github.com/mapbox/mapbox-gl-native/pull/3170)) +- `MGLMapView` methods that alter the viewport now accept optional completion handlers. ([#3090](https://github.com/mapbox/mapbox-gl-native/pull/3090)) - Fixed an issue preventing the compass from responding to taps after the compass is moved programmatically. ([#3117](https://github.com/mapbox/mapbox-gl-native/pull/3117)) ## iOS 3.0.0 diff --git a/docs/BUILD_IOS_OSX.md b/docs/BUILD_IOS_OSX.md index 6a43025201..b862fdf5f7 100644 --- a/docs/BUILD_IOS_OSX.md +++ b/docs/BUILD_IOS_OSX.md @@ -83,7 +83,6 @@ Currently, until [#1437](https://github.com/mapbox/mapbox-gl-native/issues/1437) - `libc++.dylib` - `libsqlite3.dylib` - `libz.dylib` - - `CoreTelephony.framework` (optional, telemetry-only) 1. Add `-ObjC` to your target's "Other Linker Flags" build setting (`OTHER_LDFLAGS`). diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 239ac7ece2..7f8df61095 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -75,23 +75,6 @@ const NSTimeInterval MGLFlushInterval = 60; } else { _scale = [UIScreen mainScreen].scale; } - -#if !TARGET_OS_SIMULATOR - // Collect cellular carrier data if CoreTelephony is linked - Class MGLTelephony = NSClassFromString(@"CTTelephonyNetworkInfo"); - if (MGLTelephony) { - id telephonyNetworkInfo = [[MGLTelephony alloc] init]; - SEL subscriberCellularProviderSelector = NSSelectorFromString(@"subscriberCellularProvider"); - id carrierVendor = [telephonyNetworkInfo performSelector:subscriberCellularProviderSelector]; - - // Guard against simulator, iPod Touch, etc. - if (carrierVendor) { - SEL carrierNameSelector = NSSelectorFromString(@"carrierName"); - NSString *carrierName = [carrierVendor performSelector:carrierNameSelector]; - _carrier = carrierName; - } - } -#endif } return self; } @@ -510,13 +493,6 @@ const NSTimeInterval MGLFlushInterval = 60; [evt setValue:@((int)(100 * [UIDevice currentDevice].batteryLevel)) forKey:@"batteryLevel"]; [evt setValue:@(strongSelf.data.scale) forKey:@"resolution"]; - if (strongSelf.data.carrier) { - [evt setValue:strongSelf.data.carrier forKey:@"carrier"]; - - NSString *cell = [strongSelf currentCellularNetworkConnectionType]; - [evt setObject:(cell ? cell : [NSNull null]) forKey:@"cellularNetworkType"]; - } - MGLReachability *reachability = [MGLReachability reachabilityForLocalWiFi]; [evt setValue:([reachability isReachableViaWiFi] ? @YES : @NO) forKey:@"wifi"]; @@ -727,27 +703,6 @@ const NSTimeInterval MGLFlushInterval = 60; // Can be called from any thread. // -- (NSString *) currentCellularNetworkConnectionType { - NSString *radioTech; - - Class CTTelephonyNetworkInfo = NSClassFromString(@"CTTelephonyNetworkInfo"); - if (CTTelephonyNetworkInfo) { - id telephonyNetworkInfo = [[CTTelephonyNetworkInfo alloc] init]; - SEL currentRadioAccessTechnologySelector = NSSelectorFromString(@"currentRadioAccessTechnology"); - radioTech = ((id (*)(id, SEL))[telephonyNetworkInfo methodForSelector:currentRadioAccessTechnologySelector])(telephonyNetworkInfo, currentRadioAccessTechnologySelector); - } - - if (radioTech == nil) { - return nil; - } else if ([radioTech hasPrefix:@"CTRadioAccessTechnology"]) { - return [radioTech substringFromIndex:23]; - } else { - return @"Unknown"; - } -} - -// Can be called from any thread. -// + (BOOL) checkPushEnabled { BOOL (^pushCheckBlock)(void) = ^{ BOOL blockResult; |