Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3.14.1 candidate #137

Merged
merged 6 commits into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Amplitude-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = "Amplitude-iOS"
s.version = "3.14.0"
s.version = "3.14.1"
s.summary = "Amplitude mobile analytics iOS SDK."
s.homepage = "https://amplitude.com"
s.license = { :type => "MIT" }
s.author = { "Amplitude" => "dev@amplitude.com" }
s.source = { :git => "https://github.com/amplitude/Amplitude-iOS.git", :tag => "v3.14.0" }
s.source = { :git => "https://github.com/amplitude/Amplitude-iOS.git", :tag => "v3.14.1" }
s.ios.deployment_target = '6.0'
s.tvos.deployment_target = '9.0'
s.source_files = 'Amplitude/*', 'Amplitude/SSLCertificatePinning/*'
s.source_files = 'Amplitude/*.{h,m}', 'Amplitude/SSLCertificatePinning/*.{h,m}'
s.resources = 'Amplitude/*.der'
s.requires_arc = true
s.library = 'sqlite3.0'
Expand Down
14 changes: 13 additions & 1 deletion Amplitude.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
E98C051B1A48E7FE00800C63 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = Amplitude;
TargetAttributes = {
343AB4161CC99F4F00962943 = {
Expand Down Expand Up @@ -721,6 +721,7 @@
343AB41C1CC99F4F00962943 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -749,6 +750,7 @@
343AB41D1CC99F4F00962943 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_OBJC_ARC = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -830,8 +832,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
Expand All @@ -840,13 +844,15 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand Down Expand Up @@ -875,16 +881,20 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
Expand All @@ -904,6 +914,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_OBJC_ARC = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand All @@ -916,6 +927,7 @@
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ENABLE_OBJC_ARC = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Amplitude/AMPConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import "AMPConstants.h"

NSString *const kAMPLibrary = @"amplitude-ios";
NSString *const kAMPVersion = @"3.14.0";
NSString *const kAMPVersion = @"3.14.1";
NSString *const kAMPEventLogDomain = @"api.amplitude.com";
NSString *const kAMPEventLogUrl = @"https://api.amplitude.com/";
NSString *const kAMPDefaultInstance = @"$default_instance";
Expand Down
33 changes: 19 additions & 14 deletions Amplitude/AMPDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,28 @@ -(NSString*) model {

-(NSString*) carrier {
if (!_carrier) {
Class CTTelephonyNetworkInfo = NSClassFromString(@"CTTelephonyNetworkInfo");
SEL subscriberCellularProvider = NSSelectorFromString(@"subscriberCellularProvider");
SEL carrierName = NSSelectorFromString(@"carrierName");
if (CTTelephonyNetworkInfo && subscriberCellularProvider && carrierName) {
networkInfo = SAFE_ARC_RETAIN([[NSClassFromString(@"CTTelephonyNetworkInfo") alloc] init]);
id carrier = nil;
id (*imp1)(id, SEL) = (id (*)(id, SEL))[networkInfo methodForSelector:subscriberCellularProvider];
if (imp1) {
carrier = imp1(networkInfo, subscriberCellularProvider);
@try {
Class CTTelephonyNetworkInfo = NSClassFromString(@"CTTelephonyNetworkInfo");
SEL subscriberCellularProvider = NSSelectorFromString(@"subscriberCellularProvider");
SEL carrierName = NSSelectorFromString(@"carrierName");
if (CTTelephonyNetworkInfo && subscriberCellularProvider && carrierName) {
networkInfo = SAFE_ARC_RETAIN([[NSClassFromString(@"CTTelephonyNetworkInfo") alloc] init]);
id carrier = nil;
id (*imp1)(id, SEL) = (id (*)(id, SEL))[networkInfo methodForSelector:subscriberCellularProvider];
if (imp1) {
carrier = imp1(networkInfo, subscriberCellularProvider);
}
NSString* (*imp2)(id, SEL) = (NSString* (*)(id, SEL))[carrier methodForSelector:carrierName];
if (imp2) {
_carrier = SAFE_ARC_RETAIN(imp2(carrier, carrierName));
}
}
NSString* (*imp2)(id, SEL) = (NSString* (*)(id, SEL))[carrier methodForSelector:carrierName];
if (imp2) {
_carrier = SAFE_ARC_RETAIN(imp2(carrier, carrierName));
else {
_carrier = SAFE_ARC_RETAIN(@"Unknown");
}
}
else {
return @"Unknown";
@catch (NSException *exception) {
_carrier = SAFE_ARC_RETAIN(@"Unknown");
}
}
return _carrier;
Expand Down
2 changes: 1 addition & 1 deletion Amplitude/AMPURLConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
+ (void)sendAsynchronousRequest:(NSURLRequest *)request queue:(NSOperationQueue *)queue completionHandler:(void (^)(NSURLResponse *response, NSData *data, NSError *connectionError))handler;

@end
#endif
#endif
3 changes: 2 additions & 1 deletion Amplitude/AMPURLConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ - (void)dealloc
SAFE_ARC_RELEASE(_completionHandler);
SAFE_ARC_RELEASE(_data);
SAFE_ARC_RELEASE(_response);
SAFE_ARC_RELEASE(_delegate);
SAFE_ARC_SUPER_DEALLOC();
}

Expand Down Expand Up @@ -144,4 +145,4 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLRespon
}

@end
#endif
#endif
2 changes: 1 addition & 1 deletion Amplitude/Amplitude+SSLPinning.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
@property (nonatomic, assign) BOOL sslPinningEnabled;

@end
#endif
#endif
2 changes: 1 addition & 1 deletion Amplitude/SSLCertificatePinning/ISPCertificatePinning.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@
+ (BOOL)verifyPinnedCertificateForTrust:(SecTrustRef)trust andDomain:(NSString*)domain;

@end
#endif
#endif
2 changes: 1 addition & 1 deletion Amplitude/SSLCertificatePinning/ISPCertificatePinning.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ + (BOOL)verifyPinnedCertificateForTrust:(SecTrustRef)trust andDomain:(NSString*)
}

@end
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;

@end
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ - (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticatio


@end
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler;

@end
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticat
}

@end
#endif
#endif
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Unreleased

### 3.14.1 (March, 14, 2017)

* Catch exceptions when looking up device carrier.
* Fix build warnings caused by certificate files in the Podfile. Thanks to @benasher44 for the PR.
* Fix warnings for missing new line at end of files. Thanks to @teanet for reporting.
* Fix linker warnings when using Amplitude framework in an extension target. Thanks to @r-peck for the PR.

### 3.14.0 (February 2, 2017)

* Add support for enabling SSL-pinning via Cocoapods. Thanks to @aaronwasserman for the PR. See [Readme](https://github.com/amplitude/amplitude-ios#ssl-pinning) for more information.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A [demo application](https://github.com/amplitude/iOS-Demo) is available to show

A [demo application](https://github.com/amplitude/iOS-Extension-Demo) is available to show a simple integration in iOS extensions.

See our [SDK documentation](https://rawgit.com/amplitude/Amplitude-iOS/v3.14.0/documentation/html/index.html) for a description of all available SDK methods and classes.
See our [SDK documentation](https://rawgit.com/amplitude/Amplitude-iOS/v3.14.1/documentation/html/index.html) for a description of all available SDK methods and classes.

Our iOS SDK also supports tvOS. See [below](https://github.com/amplitude/Amplitude-iOS#tvos) for more information.

Expand All @@ -19,7 +19,7 @@ Our iOS SDK also supports tvOS. See [below](https://github.com/amplitude/Amplitu

2. [Download the source code](https://github.com/amplitude/Amplitude-iOS/archive/master.zip) and extract the zip file.

Alternatively, you can pull directly from GitHub. If you use CocoaPods, add the following line to your Podfile: `pod 'Amplitude-iOS', '~> 3.14.0'`. If you are using CocoaPods, you may skip steps 3 and 4.
Alternatively, you can pull directly from GitHub. If you use CocoaPods, add the following line to your Podfile: `pod 'Amplitude-iOS', '~> 3.14.1'`. If you are using CocoaPods, you may skip steps 3 and 4.

You also have the option to install using Carthage. If you are using Carthage, add the following line to your Cartfile: `github "amplitude/Amplitude-iOS"`. Just add `#import <Amplitude/Amplitude.h>` to import all of the Amplitude header files.

Expand Down