diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index bc6dfb02b7a..4a354c31fd7 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -76,9 +76,10 @@ - (instancetype)init { _scale = [UIScreen mainScreen].scale; } +#if (!TARGET_IPHONE_SIMULATOR) // Collect cellular carrier data if CoreTelephony is linked Class CTTelephonyNetworkInfo = NSClassFromString(@"CTTelephonyNetworkInfo"); - if (CTTelephonyNetworkInfo) { + if (CTTelephonyNetworkInfo != NULL) { id telephonyNetworkInfo = [[CTTelephonyNetworkInfo alloc] init]; SEL subscriberCellularProviderSelector = NSSelectorFromString(@"subscriberCellularProvider"); @@ -88,6 +89,7 @@ - (instancetype)init { NSString *carrierName = ((id (*)(id, SEL))[carrierVendor methodForSelector:carrierNameSelector])(carrierVendor, carrierNameSelector); _carrier = carrierName; } +#endif } return self; }