From ef26dcf1727adaf8b35beb15fc884103481d0f3b Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 5 Nov 2020 09:24:01 -0800 Subject: [PATCH 1/8] Set target OS versions consistently across the board. --- Analytics.podspec | 2 +- Package.swift | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Analytics.podspec b/Analytics.podspec index c7f7f28e1..6a2ac295d 100644 --- a/Analytics.podspec +++ b/Analytics.podspec @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/segmentio/analytics-ios.git", :tag => s.version.to_s } s.social_media_url = 'https://twitter.com/segment' - s.ios.deployment_target = '11.0' + s.ios.deployment_target = '10.0' s.tvos.deployment_target = '9.0' s.ios.frameworks = 'CoreTelephony' diff --git a/Package.swift b/Package.swift index 0dc6c188b..3d1e92c0d 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "Segment", platforms: [ - .iOS(.v12), .tvOS(.v12) + .iOS(.v10), .tvOS(.v9), .macOS(.v10_15) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. @@ -31,10 +31,7 @@ let package = Package( cSettings: [ .headerSearchPath("Internal"), .headerSearchPath("Classes") - ], - linkerSettings: [ - .linkedFramework("CoreTelephony", .when(platforms: [.iOS, .macOS])) ] - ), + ) ] ) From 4d124604def490a996a1652670088ff4bb2bbf81 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 5 Nov 2020 09:24:30 -0800 Subject: [PATCH 2/8] Fixed warning w/ shadow var --- Segment/Internal/SEGState.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Segment/Internal/SEGState.m b/Segment/Internal/SEGState.m index 2fbaa0760..b5791b7cf 100644 --- a/Segment/Internal/SEGState.m +++ b/Segment/Internal/SEGState.m @@ -28,7 +28,7 @@ - (id)valueWithBlock:(SEGStateGetBlock)block; @protocol SEGStateObject @property (nonatomic, weak) SEGState *state; -- (instancetype)initWithState:(SEGState *)state; +- (instancetype)initWithState:(SEGState *)aState; @end @@ -50,10 +50,10 @@ @implementation SEGUserInfo @synthesize userId = _userId; @synthesize traits = _traits; -- (instancetype)initWithState:(SEGState *)state +- (instancetype)initWithState:(SEGState *)aState { if (self = [super init]) { - self.state = state; + self.state = aState; } return self; } @@ -114,10 +114,10 @@ @implementation SEGPayloadContext @synthesize cachedStaticContext = _cachedStaticContext; @synthesize deviceToken = _deviceToken; -- (instancetype)initWithState:(SEGState *)state +- (instancetype)initWithState:(SEGState *)aState { if (self = [super init]) { - self.state = state; + self.state = aState; self.reachability = [SEGReachability reachabilityWithHostname:@"google.com"]; [self.reachability startNotifier]; } From 9fb78adec8f8bdda5190af88173f0a2a63256fd5 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 5 Nov 2020 09:28:54 -0800 Subject: [PATCH 3/8] Use @import directive where possible. --- Segment/Classes/SEGAliasPayload.h | 2 +- Segment/Classes/SEGAnalytics.h | 2 +- Segment/Classes/SEGAnalyticsConfiguration.h | 6 +++--- Segment/Classes/SEGAnalyticsConfiguration.m | 4 ++-- Segment/Classes/SEGAnalyticsUtils.h | 2 +- Segment/Classes/SEGContext.h | 2 +- Segment/Classes/SEGCrypto.h | 2 +- Segment/Classes/SEGGroupPayload.h | 2 +- Segment/Classes/SEGHTTPClient.h | 2 +- Segment/Classes/SEGIdentifyPayload.h | 2 +- Segment/Classes/SEGIntegration.h | 2 +- Segment/Classes/SEGIntegrationFactory.h | 2 +- Segment/Classes/SEGMiddleware.h | 2 +- Segment/Classes/SEGPayload.h | 2 +- Segment/Classes/SEGReachability.h | 4 ++-- Segment/Classes/SEGScreenPayload.h | 2 +- Segment/Classes/SEGScreenReporting.h | 4 ++-- Segment/Classes/SEGSegmentIntegration.h | 2 +- Segment/Classes/SEGSegmentIntegration.m | 5 ++--- Segment/Classes/SEGSegmentIntegrationFactory.h | 2 +- Segment/Classes/SEGSerializableValue.h | 2 +- Segment/Classes/SEGStorage.h | 2 +- Segment/Classes/SEGTrackPayload.h | 2 +- Segment/Classes/SEGWebhookIntegration.m | 2 +- Segment/Classes/Segment.h | 2 +- Segment/Internal/NSData+SEGGZIP.h | 2 +- Segment/Internal/NSViewController+SEGScreen.h | 2 +- Segment/Internal/SEGAES256Crypto.h | 2 +- Segment/Internal/SEGFileStorage.h | 2 +- Segment/Internal/SEGIntegrationsManager.h | 2 +- Segment/Internal/SEGIntegrationsManager.m | 2 +- Segment/Internal/SEGState.h | 2 +- Segment/Internal/SEGStoreKitTracker.h | 4 ++-- Segment/Internal/SEGUserDefaultsStorage.h | 2 +- Segment/Internal/SEGUtils.h | 2 +- Segment/Internal/SEGUtils.m | 5 ++--- Segment/Internal/UIViewController+SEGScreen.h | 2 +- SegmentTests/SerializationTests.m | 2 +- SegmentTests/Utils/NSData+SEGGUNZIPP.h | 2 +- SegmentTests/Utils/ObjcUtils.h | 2 +- 40 files changed, 48 insertions(+), 50 deletions(-) diff --git a/Segment/Classes/SEGAliasPayload.h b/Segment/Classes/SEGAliasPayload.h index 9983151af..8f320048c 100644 --- a/Segment/Classes/SEGAliasPayload.h +++ b/Segment/Classes/SEGAliasPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGPayload.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGAnalytics.h b/Segment/Classes/SEGAnalytics.h index 081e3f24d..faf20a62f 100644 --- a/Segment/Classes/SEGAnalytics.h +++ b/Segment/Classes/SEGAnalytics.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGIntegrationFactory.h" #import "SEGCrypto.h" #import "SEGAnalyticsConfiguration.h" diff --git a/Segment/Classes/SEGAnalyticsConfiguration.h b/Segment/Classes/SEGAnalyticsConfiguration.h index 588dc660e..867e8226f 100644 --- a/Segment/Classes/SEGAnalyticsConfiguration.h +++ b/Segment/Classes/SEGAnalyticsConfiguration.h @@ -6,12 +6,12 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #if TARGET_OS_IPHONE -#import +@import UIKit; #elif TARGET_OS_OSX -#import +@import Cocoa; #endif NS_SWIFT_NAME(ApplicationProtocol) diff --git a/Segment/Classes/SEGAnalyticsConfiguration.m b/Segment/Classes/SEGAnalyticsConfiguration.m index 1177882c8..3c7208a8a 100644 --- a/Segment/Classes/SEGAnalyticsConfiguration.m +++ b/Segment/Classes/SEGAnalyticsConfiguration.m @@ -11,9 +11,9 @@ #import "SEGMiddleware.h" #import "SEGCrypto.h" #if TARGET_OS_IPHONE -#import +@import UIKit; #elif TARGET_OS_OSX -#import +@import Cocoa; #endif #if TARGET_OS_IPHONE diff --git a/Segment/Classes/SEGAnalyticsUtils.h b/Segment/Classes/SEGAnalyticsUtils.h index 26857fdd4..233ae3703 100644 --- a/Segment/Classes/SEGAnalyticsUtils.h +++ b/Segment/Classes/SEGAnalyticsUtils.h @@ -1,4 +1,4 @@ -#import +@import Foundation; NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGContext.h b/Segment/Classes/SEGContext.h index 48af05526..f2823074f 100644 --- a/Segment/Classes/SEGContext.h +++ b/Segment/Classes/SEGContext.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGIntegration.h" typedef NS_ENUM(NSInteger, SEGEventType) { diff --git a/Segment/Classes/SEGCrypto.h b/Segment/Classes/SEGCrypto.h index 6a6be0c91..cd8ea5d64 100644 --- a/Segment/Classes/SEGCrypto.h +++ b/Segment/Classes/SEGCrypto.h @@ -5,7 +5,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; @protocol SEGCrypto diff --git a/Segment/Classes/SEGGroupPayload.h b/Segment/Classes/SEGGroupPayload.h index 2c823aa0d..3ef7e61d1 100644 --- a/Segment/Classes/SEGGroupPayload.h +++ b/Segment/Classes/SEGGroupPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGPayload.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGHTTPClient.h b/Segment/Classes/SEGHTTPClient.h index d96254343..02bbbed89 100644 --- a/Segment/Classes/SEGHTTPClient.h +++ b/Segment/Classes/SEGHTTPClient.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGAnalytics.h" // TODO: Make this configurable via SEGAnalyticsConfiguration diff --git a/Segment/Classes/SEGIdentifyPayload.h b/Segment/Classes/SEGIdentifyPayload.h index b4bf3355c..3b4e41a2f 100644 --- a/Segment/Classes/SEGIdentifyPayload.h +++ b/Segment/Classes/SEGIdentifyPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGPayload.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGIntegration.h b/Segment/Classes/SEGIntegration.h index 0820aafdd..daf06bb82 100644 --- a/Segment/Classes/SEGIntegration.h +++ b/Segment/Classes/SEGIntegration.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGIdentifyPayload.h" #import "SEGTrackPayload.h" #import "SEGScreenPayload.h" diff --git a/Segment/Classes/SEGIntegrationFactory.h b/Segment/Classes/SEGIntegrationFactory.h index c05137518..b3b15526d 100644 --- a/Segment/Classes/SEGIntegrationFactory.h +++ b/Segment/Classes/SEGIntegrationFactory.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGIntegration.h" #import "SEGAnalytics.h" diff --git a/Segment/Classes/SEGMiddleware.h b/Segment/Classes/SEGMiddleware.h index 50ede531d..a3c79ae2d 100644 --- a/Segment/Classes/SEGMiddleware.h +++ b/Segment/Classes/SEGMiddleware.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGContext.h" typedef void (^SEGMiddlewareNext)(SEGContext *_Nullable newContext); diff --git a/Segment/Classes/SEGPayload.h b/Segment/Classes/SEGPayload.h index 6368cc45f..5c594b184 100644 --- a/Segment/Classes/SEGPayload.h +++ b/Segment/Classes/SEGPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGSerializableValue.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGReachability.h b/Segment/Classes/SEGReachability.h index d30415890..e96e2cda9 100644 --- a/Segment/Classes/SEGReachability.h +++ b/Segment/Classes/SEGReachability.h @@ -21,8 +21,8 @@ POSSIBILITY OF SUCH DAMAGE. */ -#import -#import +@import Foundation; +@import SystemConfiguration; /** * Does ARC support GCD objects? diff --git a/Segment/Classes/SEGScreenPayload.h b/Segment/Classes/SEGScreenPayload.h index 0fa202567..8ffb5ebf7 100644 --- a/Segment/Classes/SEGScreenPayload.h +++ b/Segment/Classes/SEGScreenPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGPayload.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGScreenReporting.h b/Segment/Classes/SEGScreenReporting.h index 1cce6c7dc..ffe7038b0 100644 --- a/Segment/Classes/SEGScreenReporting.h +++ b/Segment/Classes/SEGScreenReporting.h @@ -1,7 +1,7 @@ #if TARGET_OS_IPHONE -#import +@import UIKit; #elif TARGET_OS_OSX -#import +@import Cocoa; #endif #import "SEGSerializableValue.h" diff --git a/Segment/Classes/SEGSegmentIntegration.h b/Segment/Classes/SEGSegmentIntegration.h index 3dacd3557..281f7c2ca 100644 --- a/Segment/Classes/SEGSegmentIntegration.h +++ b/Segment/Classes/SEGSegmentIntegration.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGIntegration.h" #import "SEGHTTPClient.h" #import "SEGStorage.h" diff --git a/Segment/Classes/SEGSegmentIntegration.m b/Segment/Classes/SEGSegmentIntegration.m index a16b1f00c..3cab146d1 100644 --- a/Segment/Classes/SEGSegmentIntegration.m +++ b/Segment/Classes/SEGSegmentIntegration.m @@ -10,12 +10,11 @@ #import "SEGState.h" #if TARGET_OS_IPHONE -#import +@import UIKit; #endif #if TARGET_OS_IOS -#import -#import +@import CoreTelephony; #endif NSString *const SEGSegmentDidSendRequestNotification = @"SegmentDidSendRequest"; diff --git a/Segment/Classes/SEGSegmentIntegrationFactory.h b/Segment/Classes/SEGSegmentIntegrationFactory.h index b80a572b0..06c1c0dc0 100644 --- a/Segment/Classes/SEGSegmentIntegrationFactory.h +++ b/Segment/Classes/SEGSegmentIntegrationFactory.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGIntegrationFactory.h" #import "SEGHTTPClient.h" #import "SEGStorage.h" diff --git a/Segment/Classes/SEGSerializableValue.h b/Segment/Classes/SEGSerializableValue.h index f3977c6b3..e9802cc70 100644 --- a/Segment/Classes/SEGSerializableValue.h +++ b/Segment/Classes/SEGSerializableValue.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; /* Acceptable dictionary values are diff --git a/Segment/Classes/SEGStorage.h b/Segment/Classes/SEGStorage.h index 62a3005f9..61cc48fb9 100644 --- a/Segment/Classes/SEGStorage.h +++ b/Segment/Classes/SEGStorage.h @@ -5,7 +5,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGCrypto.h" @protocol SEGStorage diff --git a/Segment/Classes/SEGTrackPayload.h b/Segment/Classes/SEGTrackPayload.h index feefb91a7..b668d4f02 100644 --- a/Segment/Classes/SEGTrackPayload.h +++ b/Segment/Classes/SEGTrackPayload.h @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGPayload.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Classes/SEGWebhookIntegration.m b/Segment/Classes/SEGWebhookIntegration.m index b52ceff70..7a98455d9 100644 --- a/Segment/Classes/SEGWebhookIntegration.m +++ b/Segment/Classes/SEGWebhookIntegration.m @@ -1,4 +1,4 @@ -#import +@import Foundation; #import "SEGWebhookIntegration.h" #import "SEGHTTPClient.h" #import "SEGState.h" diff --git a/Segment/Classes/Segment.h b/Segment/Classes/Segment.h index 8a1428779..c6856c899 100644 --- a/Segment/Classes/Segment.h +++ b/Segment/Classes/Segment.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; //! Project version number for Analytics. FOUNDATION_EXPORT double SegmentVersionNumber; diff --git a/Segment/Internal/NSData+SEGGZIP.h b/Segment/Internal/NSData+SEGGZIP.h index 01193badd..2c291977a 100644 --- a/Segment/Internal/NSData+SEGGZIP.h +++ b/Segment/Internal/NSData+SEGGZIP.h @@ -31,7 +31,7 @@ // -#import +@import Foundation; extern void *_Nullable seg_libzOpen(void); diff --git a/Segment/Internal/NSViewController+SEGScreen.h b/Segment/Internal/NSViewController+SEGScreen.h index 6e4b54bff..8d9fdcd3b 100644 --- a/Segment/Internal/NSViewController+SEGScreen.h +++ b/Segment/Internal/NSViewController+SEGScreen.h @@ -9,7 +9,7 @@ #import "SEGSerializableValue.h" #if TARGET_OS_OSX -#import +@import Cocoa; @interface NSViewController (SEGScreen) diff --git a/Segment/Internal/SEGAES256Crypto.h b/Segment/Internal/SEGAES256Crypto.h index c8ff7e3b3..85d8d7d6c 100644 --- a/Segment/Internal/SEGAES256Crypto.h +++ b/Segment/Internal/SEGAES256Crypto.h @@ -5,7 +5,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGCrypto.h" diff --git a/Segment/Internal/SEGFileStorage.h b/Segment/Internal/SEGFileStorage.h index ca872c29c..5a35b9c43 100644 --- a/Segment/Internal/SEGFileStorage.h +++ b/Segment/Internal/SEGFileStorage.h @@ -5,7 +5,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGStorage.h" diff --git a/Segment/Internal/SEGIntegrationsManager.h b/Segment/Internal/SEGIntegrationsManager.h index 661888e96..17f500d1b 100644 --- a/Segment/Internal/SEGIntegrationsManager.h +++ b/Segment/Internal/SEGIntegrationsManager.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGMiddleware.h" /** diff --git a/Segment/Internal/SEGIntegrationsManager.m b/Segment/Internal/SEGIntegrationsManager.m index 427bb5894..e1455e45f 100644 --- a/Segment/Internal/SEGIntegrationsManager.m +++ b/Segment/Internal/SEGIntegrationsManager.m @@ -7,7 +7,7 @@ // #if TARGET_OS_IPHONE -#import +@import UIKit; #endif #import #import "SEGAnalyticsUtils.h" diff --git a/Segment/Internal/SEGState.h b/Segment/Internal/SEGState.h index 7b523b2cb..2bf20e4a9 100644 --- a/Segment/Internal/SEGState.h +++ b/Segment/Internal/SEGState.h @@ -6,7 +6,7 @@ // Copyright © 2020 Segment. All rights reserved. // -#import +@import Foundation; NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Internal/SEGStoreKitTracker.h b/Segment/Internal/SEGStoreKitTracker.h index 87ede731c..40636215e 100644 --- a/Segment/Internal/SEGStoreKitTracker.h +++ b/Segment/Internal/SEGStoreKitTracker.h @@ -1,5 +1,5 @@ -#import -#import +@import Foundation; +@import StoreKit; #import "SEGAnalytics.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Segment/Internal/SEGUserDefaultsStorage.h b/Segment/Internal/SEGUserDefaultsStorage.h index a67448ec3..36b1d7082 100644 --- a/Segment/Internal/SEGUserDefaultsStorage.h +++ b/Segment/Internal/SEGUserDefaultsStorage.h @@ -6,7 +6,7 @@ // Copyright © 2016 Segment. All rights reserved. // -#import +@import Foundation; #import "SEGStorage.h" diff --git a/Segment/Internal/SEGUtils.h b/Segment/Internal/SEGUtils.h index 2b067a3fa..4bc585fa5 100644 --- a/Segment/Internal/SEGUtils.h +++ b/Segment/Internal/SEGUtils.h @@ -3,7 +3,7 @@ // // -#import +@import Foundation; #import "SEGAnalyticsUtils.h" #import "SEGSerializableValue.h" diff --git a/Segment/Internal/SEGUtils.m b/Segment/Internal/SEGUtils.m index b1e1e59cd..e5de6cc07 100644 --- a/Segment/Internal/SEGUtils.m +++ b/Segment/Internal/SEGUtils.m @@ -11,12 +11,11 @@ #include #if TARGET_OS_IOS && TARGET_OS_MACCATALYST == 0 -#import -#import +@import CoreTelephony; static CTTelephonyNetworkInfo *_telephonyNetworkInfo; #elif TARGET_OS_OSX -#import +@import Cocoa; #endif @implementation SEGUtils diff --git a/Segment/Internal/UIViewController+SEGScreen.h b/Segment/Internal/UIViewController+SEGScreen.h index 8be5c8565..6b81b6049 100644 --- a/Segment/Internal/UIViewController+SEGScreen.h +++ b/Segment/Internal/UIViewController+SEGScreen.h @@ -1,7 +1,7 @@ #import "SEGSerializableValue.h" #if TARGET_OS_IPHONE -#import +@import UIKit; @interface UIViewController (SEGScreen) diff --git a/SegmentTests/SerializationTests.m b/SegmentTests/SerializationTests.m index efbfe652e..04c9ccc3a 100644 --- a/SegmentTests/SerializationTests.m +++ b/SegmentTests/SerializationTests.m @@ -6,7 +6,7 @@ // Copyright © 2019 Segment. All rights reserved. // -#import +@import XCTest; @import Segment; #pragma mark - Internal copy-overs for testing diff --git a/SegmentTests/Utils/NSData+SEGGUNZIPP.h b/SegmentTests/Utils/NSData+SEGGUNZIPP.h index a508e6e53..eba36bdb6 100644 --- a/SegmentTests/Utils/NSData+SEGGUNZIPP.h +++ b/SegmentTests/Utils/NSData+SEGGUNZIPP.h @@ -7,7 +7,7 @@ // // https://github.com/nicklockwood/GZIP/blob/master/GZIP/NSData%2BGZIP.m -#import +@import Foundation; @interface NSData (SEGGUNZIPP) diff --git a/SegmentTests/Utils/ObjcUtils.h b/SegmentTests/Utils/ObjcUtils.h index 9008f7eca..fa55933d6 100644 --- a/SegmentTests/Utils/ObjcUtils.h +++ b/SegmentTests/Utils/ObjcUtils.h @@ -6,6 +6,6 @@ // Copyright © 2020 Segment. All rights reserved. // -#import +@import Foundation; NSException * _Nullable objc_tryCatch(void (^ _Nonnull block)(void)); From f2b6bafbf0d4af400c1e126eeafa4fdda3aecb60 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 5 Nov 2020 11:31:55 -0800 Subject: [PATCH 4/8] Removed linked frameworks; Prefer language feature imports instead. --- Analytics.podspec | 3 --- 1 file changed, 3 deletions(-) diff --git a/Analytics.podspec b/Analytics.podspec index 6a2ac295d..e70f47e33 100644 --- a/Analytics.podspec +++ b/Analytics.podspec @@ -18,9 +18,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '10.0' s.tvos.deployment_target = '9.0' - s.ios.frameworks = 'CoreTelephony' - s.frameworks = 'Security', 'StoreKit', 'SystemConfiguration', 'UIKit' - s.source_files = [ 'Segment/Classes/**/*.{h,m}', 'Segment/Internal/**/*.{h,m}' From 2f4595a658a5060ef8e702a26f02288dab0d1f0a Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Thu, 5 Nov 2020 11:38:21 -0800 Subject: [PATCH 5/8] Fixed warning about viewDidAppear selector on macOS --- Segment/Internal/NSViewController+SEGScreen.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Segment/Internal/NSViewController+SEGScreen.m b/Segment/Internal/NSViewController+SEGScreen.m index 4558496d5..363cad0d4 100644 --- a/Segment/Internal/NSViewController+SEGScreen.m +++ b/Segment/Internal/NSViewController+SEGScreen.m @@ -12,7 +12,6 @@ #import "SEGAnalyticsUtils.h" #import "SEGScreenReporting.h" - #if TARGET_OS_OSX @implementation NSViewController (SEGScreen) @@ -22,7 +21,7 @@ + (void)seg_swizzleViewDidAppear dispatch_once(&onceToken, ^{ Class class = [self class]; - SEL originalSelector = @selector(viewDidAppear:); + SEL originalSelector = @selector(viewDidAppear); SEL swizzledSelector = @selector(seg_viewDidAppear:); Method originalMethod = class_getInstanceMethod(class, originalSelector); From f214cc4318091795fc5b2221c8599b30a9f72d40 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Mon, 9 Nov 2020 13:45:07 -0800 Subject: [PATCH 6/8] Fixed warnings --- Segment.xcodeproj/project.pbxproj | 4 +++- Segment.xcodeproj/xcshareddata/xcschemes/Segment.xcscheme | 2 +- .../xcshareddata/xcschemes/SegmentTests.xcscheme | 2 +- .../xcshareddata/xcschemes/SegmentTestsTVOS.xcscheme | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Segment.xcodeproj/project.pbxproj b/Segment.xcodeproj/project.pbxproj index 17f4b22f5..3887239b9 100644 --- a/Segment.xcodeproj/project.pbxproj +++ b/Segment.xcodeproj/project.pbxproj @@ -463,7 +463,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 1130; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = Segment; TargetAttributes = { EADEB85A1DECD080005322DA = { @@ -607,6 +607,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -669,6 +670,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; diff --git a/Segment.xcodeproj/xcshareddata/xcschemes/Segment.xcscheme b/Segment.xcodeproj/xcshareddata/xcschemes/Segment.xcscheme index d535f2746..ef358f336 100644 --- a/Segment.xcodeproj/xcshareddata/xcschemes/Segment.xcscheme +++ b/Segment.xcodeproj/xcshareddata/xcschemes/Segment.xcscheme @@ -1,6 +1,6 @@ Date: Wed, 11 Nov 2020 09:44:19 -0800 Subject: [PATCH 7/8] Updated version numbers for all dependencies --- Analytics.podspec | 3 ++- Package.swift | 2 +- Segment.xcodeproj/project.pbxproj | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Analytics.podspec b/Analytics.podspec index e70f47e33..cb862080b 100644 --- a/Analytics.podspec +++ b/Analytics.podspec @@ -16,7 +16,8 @@ Pod::Spec.new do |s| s.social_media_url = 'https://twitter.com/segment' s.ios.deployment_target = '10.0' - s.tvos.deployment_target = '9.0' + s.tvos.deployment_target = '10.0' + s.osx.deployment_target = '10.13' s.source_files = [ 'Segment/Classes/**/*.{h,m}', diff --git a/Package.swift b/Package.swift index 3d1e92c0d..a74362a6c 100644 --- a/Package.swift +++ b/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "Segment", platforms: [ - .iOS(.v10), .tvOS(.v9), .macOS(.v10_15) + .iOS(.v10), .tvOS(.v10), .macOS(.v10_13) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. diff --git a/Segment.xcodeproj/project.pbxproj b/Segment.xcodeproj/project.pbxproj index 3887239b9..1de660564 100644 --- a/Segment.xcodeproj/project.pbxproj +++ b/Segment.xcodeproj/project.pbxproj @@ -635,13 +635,16 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 10.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 7.0; }; name = Debug; }; @@ -692,14 +695,17 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 10.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 7.0; }; name = Release; }; @@ -726,7 +732,6 @@ SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; @@ -753,7 +758,6 @@ SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; TARGETED_DEVICE_FAMILY = "1,2,3"; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; From df340c25871945c42f9dd6c2b1280a26410280ae Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Wed, 11 Nov 2020 10:21:53 -0800 Subject: [PATCH 8/8] Additional fixups --- Segment.xcodeproj/project.pbxproj | 10 ++++------ Segment/Classes/SEGSegmentIntegration.m | 4 ---- Segment/Internal/SEGUtils.m | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Segment.xcodeproj/project.pbxproj b/Segment.xcodeproj/project.pbxproj index 1de660564..95c460f25 100644 --- a/Segment.xcodeproj/project.pbxproj +++ b/Segment.xcodeproj/project.pbxproj @@ -639,8 +639,9 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 10.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -698,9 +699,10 @@ MACOSX_DEPLOYMENT_TARGET = 10.13; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 10.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -730,8 +732,6 @@ "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; - TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Debug; }; @@ -756,8 +756,6 @@ "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvos appletvsimulator macosx"; - TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Release; }; diff --git a/Segment/Classes/SEGSegmentIntegration.m b/Segment/Classes/SEGSegmentIntegration.m index 3cab146d1..390abbf52 100644 --- a/Segment/Classes/SEGSegmentIntegration.m +++ b/Segment/Classes/SEGSegmentIntegration.m @@ -13,10 +13,6 @@ @import UIKit; #endif -#if TARGET_OS_IOS -@import CoreTelephony; -#endif - NSString *const SEGSegmentDidSendRequestNotification = @"SegmentDidSendRequest"; NSString *const SEGSegmentRequestDidSucceedNotification = @"SegmentRequestDidSucceed"; NSString *const SEGSegmentRequestDidFailNotification = @"SegmentRequestDidFail"; diff --git a/Segment/Internal/SEGUtils.m b/Segment/Internal/SEGUtils.m index e5de6cc07..7e2aff309 100644 --- a/Segment/Internal/SEGUtils.m +++ b/Segment/Internal/SEGUtils.m @@ -10,12 +10,9 @@ #include -#if TARGET_OS_IOS && TARGET_OS_MACCATALYST == 0 +#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST @import CoreTelephony; - static CTTelephonyNetworkInfo *_telephonyNetworkInfo; -#elif TARGET_OS_OSX -@import Cocoa; #endif @implementation SEGUtils @@ -332,7 +329,7 @@ BOOL getAdTrackingEnabled(SEGAnalyticsConfiguration *configuration) network[@"cellular"] = @(reachability.isReachableViaWWAN); } -#if TARGET_OS_IOS && TARGET_OS_MACCATALYST == 0 +#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST static dispatch_once_t networkInfoOnceToken; dispatch_once(&networkInfoOnceToken, ^{ _telephonyNetworkInfo = [[CTTelephonyNetworkInfo alloc] init];