Skip to content

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderdean committed Apr 29, 2018
2 parents 2ae91e4 + b4f78fb commit 979cd95
Show file tree
Hide file tree
Showing 152 changed files with 13,329 additions and 138 deletions.
18 changes: 14 additions & 4 deletions .travis.yml
Expand Up @@ -4,22 +4,32 @@ osx_image: xcode9.1

env:
matrix:
- TEST_PLATFORM="platform=iOS Simulator,OS=8.1,name=iPhone 5s"
- TEST_PLATFORM="platform=iOS Simulator,OS=9.0,name=iPhone 6"
- TEST_PLATFORM="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
- TEST_PLATFORM="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
- TEST_PLATFORM="platform=iOS Simulator,OS=11.1,name=iPhone 8"

rvm:
- 2.2.2

before_install:
- gem install cocoapods -v '1.3.1'
- gem install cocoapods -v '1.4.0'
- gem install slather
- gem install xcpretty -N --no-ri --no-rdoc
- brew update
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
- pod repo update
- pod install
- pod update

script:
- set -o pipefail
- xcodebuild clean test -sdk iphonesimulator -destination "${TEST_PLATFORM}" -workspace Snowplow.xcworkspace -scheme Snowplow CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO | xcpretty
# next command is broken up multiline for ease of editing
- >-
xcodebuild -sdk iphonesimulator
-destination "${TEST_PLATFORM}"
-workspace Snowplow.xcworkspace
-scheme Snowplow
clean test
| xcpretty
after_success: slather
19 changes: 18 additions & 1 deletion CHANGELOG
@@ -1,3 +1,20 @@
Version 0.8.0 (2018-04-29)
--------------------------
Update CocoaPods to 1.4.0 and add pod update repo in build script (#347)
Add method to SPTracker to get session's userId (#345)
Drop iOS 8 test target, add iOS 10 and 11 (#344)
Fix SnowplowTests bundle custom folder name (#343)
Add a Swift port of SnowplowDemo (#342)
Add identifyUser as alias for setUserId (#341)
Add trackConsentGrantedEvent and trackConsentWithdrawnEvent methods (#340)
Remove "close" from CHANGELOG for issue #333 (#338)
Add support for push notification open tracking (#335)
Add preprocessor flags to disable OpenIDFA or IDFV (#334)
Extend copyright notice in all files to 2018 (#331)
Replace NSGregorianCalendar with NSCalendarIdentifierGregorian (#329)
Fix truncation of structured event value to 6 digits (#299)
Add trackSelfDescribingEvent method as alias for trackUnstructEvent (#272)

Version 0.7.0 (2017-12-24)
--------------------------
Bump iOS deployment target to 8.0 (#326)
Expand All @@ -8,7 +25,7 @@ Use default Bundler version in Travis (#336)
Fix invalid latitude in test suite (#322)
Don't attempt to serialize nil object in event store (#286)
Fix method description typos (#317)
Update README markdown in accordance with CommonMark (close #333)
Update README markdown in accordance with CommonMark (#333)

Version 0.6.2 (2016-10-10)
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion Snowplow-OSXTests/SnowplowTests.m
Expand Up @@ -3,7 +3,7 @@
// Snowplow
//
// Created by James Duncan Davidson on 2/10/15.
// Copyright (c) 2015 Snowplow Analytics. All rights reserved.
// Copyright (c) 2015-2018 Snowplow Analytics. All rights reserved.
//

#import <Cocoa/Cocoa.h>
Expand Down
20 changes: 12 additions & 8 deletions Snowplow.xcodeproj/project.pbxproj
Expand Up @@ -36,14 +36,14 @@
04ABC3621B9088DA00F50CAD /* TestSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 04ABC3611B9088DA00F50CAD /* TestSession.m */; };
04ABC3631B9088DA00F50CAD /* TestSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 04ABC3611B9088DA00F50CAD /* TestSession.m */; };
04ABC3641B908E6500F50CAD /* TestUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFCC377192325FB00FAE8FE /* TestUtils.m */; };
04B41EAA1BB2843F007C19C8 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 04B41EA91BB2843F007C19C8 /* Resources */; };
04EF45611BB01C26008E5E8B /* TestSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 04EF45601BB01C26008E5E8B /* TestSelfDescribingJson.m */; };
04EF45621BB01C26008E5E8B /* TestSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 04EF45601BB01C26008E5E8B /* TestSelfDescribingJson.m */; };
04F4334F1B7A360E00035CDC /* SPRequestResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 0413DD761B78D643000D2112 /* SPRequestResponse.m */; };
140454A81B399B9BD12C2030 /* libPods-Snowplow-OSX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3950A58E0CFC6101746B4C28 /* libPods-Snowplow-OSX.a */; };
24103385337EE3892FDCDE3E /* libPods-Snowplow.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42CE2733D73A2C7D4E3888FB /* libPods-Snowplow.a */; };
4C5E98E9C0215549D74F9396 /* libPods-Base-Snowplow-OSX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AEFD2A3839970FE05343E80B /* libPods-Base-Snowplow-OSX.a */; };
739CB86F6E68F675EBA47AE2 /* libPods-SnowplowTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D284B1244765020D7B12B722 /* libPods-SnowplowTests.a */; };
75907E3C200EB0C000096DB1 /* Products in Resources */ = {isa = PBXBuildFile; fileRef = 75907E3B200EB0C000096DB1 /* Products */; };
968F9AB1BB9FC18F0D22FB63 /* libPods-BaseTests-Snowplow-OSXTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 717C9BDC06316B667870FEE3 /* libPods-BaseTests-Snowplow-OSXTests.a */; };
AB0C27C1191B408200018557 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0C27C0191B408200018557 /* Foundation.framework */; };
AB0C27CF191B408200018557 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0C27CE191B408200018557 /* XCTest.framework */; };
Expand Down Expand Up @@ -145,6 +145,7 @@
42CE2733D73A2C7D4E3888FB /* libPods-Snowplow.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow.a"; sourceTree = BUILT_PRODUCTS_DIR; };
66ACC5B9C3FCC32FFC03B64E /* Pods-Snowplow-OSX.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-OSX.release.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-OSX/Pods-Snowplow-OSX.release.xcconfig"; sourceTree = "<group>"; };
717C9BDC06316B667870FEE3 /* libPods-BaseTests-Snowplow-OSXTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BaseTests-Snowplow-OSXTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
75907E3B200EB0C000096DB1 /* Products */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Products; path = SnowplowTests/Products; sourceTree = "<group>"; };
832ACF462F797D21EF3D667E /* Pods-SnowplowTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SnowplowTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SnowplowTests/Pods-SnowplowTests.release.xcconfig"; sourceTree = "<group>"; };
94D24AFAC0C72DF11D744E20 /* Pods-BaseTests-Snowplow-OSXTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseTests-Snowplow-OSXTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BaseTests-Snowplow-OSXTests/Pods-BaseTests-Snowplow-OSXTests.release.xcconfig"; sourceTree = "<group>"; };
97BD0CE0229A798C94CE1C3D /* Pods-BaseTests-Snowplow-OSXTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseTests-Snowplow-OSXTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BaseTests-Snowplow-OSXTests/Pods-BaseTests-Snowplow-OSXTests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -255,6 +256,7 @@
AB0C27B4191B408200018557 = {
isa = PBXGroup;
children = (
75907E3B200EB0C000096DB1 /* Products */,
AB0C27C2191B408200018557 /* Snowplow */,
AB0C27D6191B408200018557 /* SnowplowTests */,
AEA2FCE41A8CDF8100123462 /* Snowplow-OSXTests */,
Expand Down Expand Up @@ -520,7 +522,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
04B41EAA1BB2843F007C19C8 /* Resources in Resources */,
75907E3C200EB0C000096DB1 /* Products in Resources */,
AB0C27DB191B408200018557 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -543,12 +545,13 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-SnowplowTests/Pods-SnowplowTests-resources.sh",
"$PODS_CONFIGURATION_BUILD_DIR/KiteJSONValidator-iOS/KiteJSONValidator.bundle",
"$PODS_CONFIGURATION_BUILD_DIR/SnowplowIgluClient-iOS/SnowplowIgluResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/KiteJSONValidator-iOS/KiteJSONValidator.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SnowplowIgluClient-iOS/SnowplowIgluResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/KiteJSONValidator.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SnowplowIgluResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -676,12 +679,13 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-BaseTests-Snowplow-OSXTests/Pods-BaseTests-Snowplow-OSXTests-resources.sh",
"$PODS_CONFIGURATION_BUILD_DIR/KiteJSONValidator-macOS/KiteJSONValidator.bundle",
"$PODS_CONFIGURATION_BUILD_DIR/SnowplowIgluClient-macOS/SnowplowIgluResources.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/KiteJSONValidator-macOS/KiteJSONValidator.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SnowplowIgluClient-macOS/SnowplowIgluResources.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/KiteJSONValidator.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SnowplowIgluResources.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
7 changes: 2 additions & 5 deletions Snowplow/OpenIDFA.m
Expand Up @@ -197,11 +197,8 @@ + (NSArray*) threeDaysOpenIDFAArray {
NSDateFormatter* dateFormatter = [ [ NSDateFormatter alloc ] init ];
[ dateFormatter setDateFormat:@"yyMMdd" ];
NSCalendar *calendar;
if (SNOWPLOW_iOS_8_OR_LATER) {
calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
} else {
calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
}
calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

NSDateComponents *hourShift = [[NSDateComponents alloc] init];
[hourShift setHour:-4];
NSDate *currentDay= [calendar dateByAddingComponents:hourShift toDate:[NSDate date] options:0];
Expand Down
4 changes: 2 additions & 2 deletions Snowplow/SPEmitter.h
Expand Up @@ -2,7 +2,7 @@
// SPEmitter.h
// Snowplow
//
// Copyright (c) 2013-2015 Snowplow Analytics Ltd. All rights reserved.
// Copyright (c) 2013-2018 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0,
// and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
// language governing permissions and limitations there under.
//
// Authors: Jonathan Almeida, Joshua Beemster
// Copyright: Copyright (c) 2013-2015 Snowplow Analytics Ltd
// Copyright: Copyright (c) 2013-2018 Snowplow Analytics Ltd
// License: Apache License Version 2.0
//

Expand Down
4 changes: 2 additions & 2 deletions Snowplow/SPEmitter.m
Expand Up @@ -2,7 +2,7 @@
// SPEmitter.m
// Snowplow
//
// Copyright (c) 2013-2015 Snowplow Analytics Ltd. All rights reserved.
// Copyright (c) 2013-2018 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0,
// and you may not use this file except in compliance with the Apache License
Expand All @@ -16,7 +16,7 @@
// language governing permissions and limitations there under.
//
// Authors: Jonathan Almeida, Joshua Beemster
// Copyright: Copyright (c) 2013-2015 Snowplow Analytics Ltd
// Copyright: Copyright (c) 2013-2018 Snowplow Analytics Ltd
// License: Apache License Version 2.0
//

Expand Down
87 changes: 85 additions & 2 deletions Snowplow/SPEvent.h
Expand Up @@ -2,7 +2,7 @@
// SPEvent.h
// Snowplow
//
// Copyright (c) 2015 Snowplow Analytics Ltd. All rights reserved.
// Copyright (c) 2018 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0,
// and you may not use this file except in compliance with the Apache License
Expand All @@ -16,14 +16,15 @@
// language governing permissions and limitations there under.
//
// Authors: Joshua Beemster
// Copyright: Copyright (c) 2015 Snowplow Analytics Ltd
// Copyright: Copyright (c) 2018 Snowplow Analytics Ltd
// License: Apache License Version 2.0
//

#import <Foundation/Foundation.h>

@class SPPayload;
@class SPSelfDescribingJson;
@class SPNotificationContent;

// Builder Protocols : Defines all setter functions

Expand Down Expand Up @@ -56,6 +57,31 @@
- (void) setId:(NSString *)sId;
@end

@protocol SPConsentWithdrawnBuilder <SPEventBuilder>
- (void) setDocumentId:(NSString *)documentId;
- (void) setVersion:(NSString *)version;
- (void) setName:(NSString *)name;
- (void) setDescription:(NSString *)description;
- (void) setAll:(BOOL *)all;
- (void) setDocuments:(NSArray *)documents;
@end

@protocol SPConsentDocumentBuilder <SPEventBuilder>
- (void) setDocumentId:(NSString *)documentId;
- (void) setVersion:(NSString *)version;
- (void) setName:(NSString *)name;
- (void) setDescription:(NSString *)description;
@end

@protocol SPConsentGrantedBuilder <SPEventBuilder>
- (void) setDocumentId:(NSString *)documentId;
- (void) setVersion:(NSString *)version;
- (void) setName:(NSString *)name;
- (void) setDescription:(NSString *)description;
- (void) setExpiry:(NSString *)expiry;
- (void) setDocuments:(NSArray *)documents;
@end

@protocol SPTimingBuilder <SPEventBuilder>
- (void) setCategory:(NSString *)category;
- (void) setVariable:(NSString *)variable;
Expand Down Expand Up @@ -86,6 +112,26 @@
- (void) setCurrency:(NSString *)currency;
@end

@protocol SPNotificationContentBuilder <SPEventBuilder>
- (void) setTitle:(NSString *)title;
- (void) setSubtitle:(NSString *)subtitle;
- (void) setBody:(NSString *)body;
- (void) setBadge:(NSNumber *)badge;
- (void) setSound:(NSString *)sound;
- (void) setLaunchImageName:(NSString *)name;
- (void) setUserInfo:(NSDictionary *)userInfo;
- (void) setAttachments:(NSArray *)attachments;
@end

@protocol SPPushNotificationBuilder <SPEventBuilder>
- (void) setAction:(NSString *)action;
- (void) setDeliveryDate:(NSString *)date;
- (void) setTrigger:(NSString *)trigger;
- (void) setCategoryIdentifier:(NSString *)category;
- (void) setThreadIdentifier:(NSString *)thread;
- (void) setNotification:(SPNotificationContent *)content;
@end

// Base Event

@interface SPEvent : NSObject <SPEventBuilder>
Expand Down Expand Up @@ -121,6 +167,29 @@
- (SPPayload *) getPayloadWithEncoding:(BOOL)encoding;
@end

// Consent Withdrawn Event

@interface SPConsentWithdrawn : SPEvent <SPConsentWithdrawnBuilder>
+ (instancetype) build:(void(^)(id<SPConsentWithdrawnBuilder>builder))buildBlock;
- (SPSelfDescribingJson *) getPayload;
- (NSArray *) getDocuments;
@end

// Consent Document Event

@interface SPConsentDocument : SPEvent <SPConsentDocumentBuilder>
+ (instancetype) build:(void(^)(id<SPConsentDocumentBuilder>builder))buildBlock;
- (SPSelfDescribingJson *) getPayload;
@end

// Consent Granted Event

@interface SPConsentGranted : SPEvent <SPConsentGrantedBuilder>
+ (instancetype) build:(void(^)(id<SPConsentGrantedBuilder>builder))buildBlock;
- (SPSelfDescribingJson *) getPayload;
- (NSArray *) getDocuments;
@end

// ScreenView Event

@interface SPScreenView : SPEvent <SPScreenViewBuilder>
Expand Down Expand Up @@ -150,3 +219,17 @@
+ (instancetype) build:(void(^)(id<SPEcommTransactionItemBuilder>builder))buildBlock;
- (SPPayload *) getPayload;
@end

// Push Notification Content Event

@interface SPNotificationContent : SPEvent <SPNotificationContentBuilder>
+ (instancetype) build:(void(^)(id<SPNotificationContentBuilder>builder))buildBlock;
- (NSDictionary *) getPayload;
@end

// Push Notification Event

@interface SPPushNotification : SPEvent <SPPushNotificationBuilder>
+ (instancetype) build:(void(^)(id<SPPushNotificationBuilder>builder))buildBlock;
- (SPSelfDescribingJson *) getPayload;
@end

0 comments on commit 979cd95

Please sign in to comment.