Skip to content

Commit

Permalink
Merge pull request #296 from snowplow/hotfix/0.6.2
Browse files Browse the repository at this point in the history
Hotfix/0.6.2
  • Loading branch information
jbeemster authored Oct 10, 2016
2 parents 86c1049 + d5e55aa commit 30636e4
Show file tree
Hide file tree
Showing 26 changed files with 101 additions and 79 deletions.
2 changes: 2 additions & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
coverage_service: coveralls
xcodeproj: Snowplow.xcodeproj
workspace: Snowplow.xcworkspace
scheme: Snowplow
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ rvm:
- 2.2.2

before_install:
- rvm @global do gem uninstall bundler --all --executables
- gem uninstall bundler --all --executables
- gem install bundler --version '1.11.2'
- gem install cocoapods -v '0.39.0'
- gem install slather
- brew update
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Version 0.6.2 (2016-10-10)
--------------------------
Fix failing geolocation_context test (#293)
Cast from NS(U)Integer to long type causes crashes on 32-bit devices, thanks @chrisfsampaio (#271)
App crashes on iPhone 4s simulator, thanks @chrisfsampaio (#278)
Fix Travis build (#295)
Fix failing getLanguage test on Travis (#294)
Correct the capitalization of Xcode in README, thanks @ReadmeCritic (#268)

Version 0.6.1 (2016-02-22)
--------------------------
Made podfile dependencies more restrictive (#266)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ With this tracker you can collect event data from your applications, games or fr

### Building the Static Framework (iOS only)

* Open `Snowplow.xcworkspace` in XCode.
* Open `Snowplow.xcworkspace` in Xcode.
* Select the `SnowplowTracker-iOS-Static` scheme and set device to `iOS Device`.
* Run `Archive` from the Product menu.
* Finder should open and show you where `SnowplowTracker.framework` is stored.

### Running the Demo Application (iOS only)

* Open `SnowplowDemo.xcworkspace` in XCode.
* Open `SnowplowDemo.xcworkspace` in Xcode.
* Select the `SnowplowDemo` scheme and set device to any emulator.
* Hit run and the demo will be installed and launched in the emulator window.
* Simply enter a valid endpoint to send events to!
Expand Down
25 changes: 14 additions & 11 deletions Snowplow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
objects = {

/* Begin PBXBuildFile section */
040296EB1BB155A700895DED /* TestGeneratedJsons.m in Sources */ = {isa = PBXBuildFile; fileRef = 040296EA1BB155A700895DED /* TestGeneratedJsons.m */; settings = {ASSET_TAGS = (); }; };
040296EB1BB155A700895DED /* TestGeneratedJsons.m in Sources */ = {isa = PBXBuildFile; fileRef = 040296EA1BB155A700895DED /* TestGeneratedJsons.m */; };
0402EBEE1BA93CCC006C8818 /* SPEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 0402EBED1BA93CCC006C8818 /* SPEvent.m */; };
0402EBEF1BA93CCC006C8818 /* SPEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 0402EBED1BA93CCC006C8818 /* SPEvent.m */; };
04062D761B8390870019B8D1 /* SPSubject.m in Sources */ = {isa = PBXBuildFile; fileRef = 04062D751B8390870019B8D1 /* SPSubject.m */; };
0413DD771B78D643000D2112 /* SPRequestResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 0413DD761B78D643000D2112 /* SPRequestResponse.m */; };
041B60A91B84C19B00A1EBCB /* SPSubject.m in Sources */ = {isa = PBXBuildFile; fileRef = 04062D751B8390870019B8D1 /* SPSubject.m */; };
042F44521BC7F41B00F43930 /* TestGeneratedJsons.m in Sources */ = {isa = PBXBuildFile; fileRef = 040296EA1BB155A700895DED /* TestGeneratedJsons.m */; settings = {ASSET_TAGS = (); }; };
042F44531BC7F59B00F43930 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 04B41EA91BB2843F007C19C8 /* Resources */; settings = {ASSET_TAGS = (); }; };
042F44521BC7F41B00F43930 /* TestGeneratedJsons.m in Sources */ = {isa = PBXBuildFile; fileRef = 040296EA1BB155A700895DED /* TestGeneratedJsons.m */; };
042F44531BC7F59B00F43930 /* Resources in Resources */ = {isa = PBXBuildFile; fileRef = 04B41EA91BB2843F007C19C8 /* Resources */; };
043EC5E01B8F049200294081 /* SPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 043EC5DF1B8F049200294081 /* SPSession.m */; };
043EC5E11B8F049200294081 /* SPSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 043EC5DF1B8F049200294081 /* SPSession.m */; };
043EC5E71B8F224900294081 /* Snowplow.m in Sources */ = {isa = PBXBuildFile; fileRef = 043EC5E61B8F224900294081 /* Snowplow.m */; };
Expand All @@ -23,8 +23,8 @@
044CA88E1B94792B000EA3B1 /* SPWeakTimerTarget.m in Sources */ = {isa = PBXBuildFile; fileRef = 044CA88C1B94792B000EA3B1 /* SPWeakTimerTarget.m */; };
047CBC7B1BD4EEDD006653B3 /* libReachability.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 047CBC7A1BD4EEDD006653B3 /* libReachability.a */; };
047CBC7D1BD4EEE2006653B3 /* libPods-lib-FMDB.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 047CBC7C1BD4EEE2006653B3 /* libPods-lib-FMDB.a */; };
0485CA161BAC65A300214BC5 /* SPSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 0485CA151BAC65A300214BC5 /* SPSelfDescribingJson.m */; settings = {ASSET_TAGS = (); }; };
0485CA171BAC65A300214BC5 /* SPSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 0485CA151BAC65A300214BC5 /* SPSelfDescribingJson.m */; settings = {ASSET_TAGS = (); }; };
0485CA161BAC65A300214BC5 /* SPSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 0485CA151BAC65A300214BC5 /* SPSelfDescribingJson.m */; };
0485CA171BAC65A300214BC5 /* SPSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 0485CA151BAC65A300214BC5 /* SPSelfDescribingJson.m */; };
04921CAF1BAABE11009E221E /* TestEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 04921CAE1BAABE11009E221E /* TestEvent.m */; };
04921CB01BAABE11009E221E /* TestEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 04921CAE1BAABE11009E221E /* TestEvent.m */; };
04ABC3591B905A5B00F50CAD /* TestSubject.m in Sources */ = {isa = PBXBuildFile; fileRef = 04ABC3581B905A5B00F50CAD /* TestSubject.m */; };
Expand All @@ -36,9 +36,9 @@
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 */; settings = {ASSET_TAGS = (); }; };
04EF45611BB01C26008E5E8B /* TestSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 04EF45601BB01C26008E5E8B /* TestSelfDescribingJson.m */; settings = {ASSET_TAGS = (); }; };
04EF45621BB01C26008E5E8B /* TestSelfDescribingJson.m in Sources */ = {isa = PBXBuildFile; fileRef = 04EF45601BB01C26008E5E8B /* TestSelfDescribingJson.m */; settings = {ASSET_TAGS = (); }; };
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 */; };
1986201FC02601DFE2A62AC3 /* libPods-Snowplow-OSXTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2B61D6274CCDEF01550CC85 /* libPods-Snowplow-OSXTests.a */; };
46A289CC9C4B3D542DF28F92 /* libPods-Snowplow-OSX.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D350F2E758CBC781DDD5DDF7 /* libPods-Snowplow-OSX.a */; };
Expand Down Expand Up @@ -788,6 +788,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -827,6 +828,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_CODE_COVERAGE = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
Expand Down Expand Up @@ -866,7 +868,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Pods/build/Debug-iphoneos",
);
ONLY_ACTIVE_ARCH = NO;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
Expand Down Expand Up @@ -895,6 +897,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Pods/build/Debug-iphoneos",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"$(inherited)",
"-isystem",
Expand Down Expand Up @@ -927,7 +930,7 @@
);
INFOPLIST_FILE = "SnowplowTests/SnowplowTests-Info.plist";
LIBRARY_SEARCH_PATHS = "$(inherited)";
ONLY_ACTIVE_ARCH = NO;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(inherited)";
PODS_ROOT = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -948,7 +951,7 @@
GCC_PREFIX_HEADER = "Snowplow/Snowplow-Prefix.pch";
INFOPLIST_FILE = "SnowplowTests/SnowplowTests-Info.plist";
LIBRARY_SEARCH_PATHS = "$(inherited)";
ONLY_ACTIVE_ARCH = NO;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(inherited)";
PODS_ROOT = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
3 changes: 2 additions & 1 deletion Snowplow.xcodeproj/xcshareddata/xcschemes/Snowplow.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
6 changes: 3 additions & 3 deletions Snowplow/SPEmitter.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ - (void) sendEvents {
for (NSDictionary * eventWithMetaData in listValues) {
NSArray *indexArray = [NSArray arrayWithObject:[eventWithMetaData objectForKey:@"ID"]];
NSMutableDictionary *eventPayload = [[eventWithMetaData objectForKey:@"eventData"] mutableCopy];
[eventPayload setValue:[NSString stringWithFormat:@"%@", [@([SPUtilities getTimestamp]) stringValue]] forKey:kSPSentTimestamp];
[eventPayload setValue:[NSString stringWithFormat:@"%lld", [[SPUtilities getTimestamp] longLongValue]] forKey:kSPSentTimestamp];

// Make GET URL to send
NSString *url = [NSString stringWithFormat:@"%@?%@", [_urlEndpoint absoluteString], [SPUtilities urlEncodeDictionary:eventPayload]];
Expand Down Expand Up @@ -360,9 +360,9 @@ - (NSMutableURLRequest *) getRequestGetWithString:(NSString *)url {
}

- (void) addStmToEventPayloadsWithArray:(NSArray *)eventArray {
NSInteger stm = [SPUtilities getTimestamp];
NSNumber *stm = [SPUtilities getTimestamp];
for (NSMutableDictionary * event in eventArray) {
[event setValue:[NSString stringWithFormat:@"%@", [@(stm) stringValue]] forKey:kSPSentTimestamp];
[event setValue:[NSString stringWithFormat:@"%lld", stm.longLongValue] forKey:kSPSentTimestamp];
}
}

Expand Down
6 changes: 3 additions & 3 deletions Snowplow/SPEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// Builder Protocols : Defines all setter functions

@protocol SPEventBuilder <NSObject>
- (void) setTimestamp:(NSInteger)timestamp;
- (void) setTimestamp:(NSNumber *)timestamp;
- (void) setContexts:(NSMutableArray *)contexts;
- (void) setEventId:(NSString *)eventId;
@end
Expand Down Expand Up @@ -90,12 +90,12 @@

@interface SPEvent : NSObject <SPEventBuilder>

@property (nonatomic, readwrite) NSInteger timestamp;
@property (nonatomic, readwrite) NSNumber *timestamp;
@property (nonatomic, readwrite, retain) NSMutableArray* contexts;
@property (nonatomic, readwrite, retain) NSString * eventId;

- (NSMutableArray *) getContexts;
- (NSInteger) getTimestamp;
- (NSNumber *) getTimestamp;
- (NSString *) getEventId;
- (SPPayload *) addDefaultParamsToPayload:(SPPayload *)pb;
@end
Expand Down
6 changes: 3 additions & 3 deletions Snowplow/SPEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (id) init {

// --- Builder Methods

- (void) setTimestamp:(NSInteger)timestamp {
- (void) setTimestamp:(NSNumber *)timestamp {
_timestamp = timestamp;
}

Expand All @@ -64,7 +64,7 @@ - (NSMutableArray *) getContexts {
return [NSMutableArray arrayWithArray:_contexts];
}

- (NSInteger) getTimestamp {
- (NSNumber *) getTimestamp {
return _timestamp;
}

Expand All @@ -73,7 +73,7 @@ - (NSString *) getEventId {
}

- (SPPayload *) addDefaultParamsToPayload:(SPPayload *)pb {
[pb addValueToPayload:[NSString stringWithFormat:@"%@", [@(_timestamp) stringValue]] forKey:kSPTimestamp];
[pb addValueToPayload:[NSString stringWithFormat:@"%lld", _timestamp.longLongValue] forKey:kSPTimestamp];
[pb addValueToPayload:_eventId forKey:kSPEid];
return pb;
}
Expand Down
2 changes: 1 addition & 1 deletion Snowplow/SPSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
* @param firstEventId The potential first event id of the session
* @return a SnowplowPayload containing the session dictionary
*/
- (NSMutableDictionary *) getSessionDictWithEventId:(NSString *)firstEventId;
- (NSDictionary *) getSessionDictWithEventId:(NSString *)firstEventId;

/**
* Returns the current session index count
Expand Down
32 changes: 18 additions & 14 deletions Snowplow/SPSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ @implementation SPSession {
NSInteger _foregroundTimeout;
NSInteger _backgroundTimeout;
NSInteger _checkInterval;
NSInteger _accessedLast;
NSNumber * _accessedLast;
BOOL _inBackground;
NSString * _userId;
NSString * _currentSessionId;
Expand All @@ -42,7 +42,8 @@ @implementation SPSession {
NSString * _sessionStorage;
NSString * _firstEventId;
NSTimer * _sessionTimer;
NSMutableDictionary * _sessionDict;
NSDictionary * _sessionDict;
dispatch_queue_t _sessionQueue;
}

NSString * const kSessionSavePath = @"session.dict";
Expand All @@ -54,12 +55,13 @@ - (id) init {
- (id) initWithForegroundTimeout:(NSInteger)foregroundTimeout andBackgroundTimeout:(NSInteger)backgroundTimeout andCheckInterval:(NSInteger)checkInterval {
self = [super init];
if (self) {
_sessionQueue = dispatch_queue_create("com.snowplow.sessionUpdates", DISPATCH_QUEUE_SERIAL);
_foregroundTimeout = foregroundTimeout * 1000;
_backgroundTimeout = backgroundTimeout * 1000;
_checkInterval = checkInterval;
_inBackground = NO;
_sessionStorage = @"SQLITE";

NSDictionary * maybeSessionDict = [self getSessionFromFile];
if (maybeSessionDict == nil) {
_userId = [SPUtilities getEventId];
Expand Down Expand Up @@ -126,13 +128,13 @@ - (void) setCheckInterval:(NSInteger)checkInterval {
[self startChecker];
}

- (NSMutableDictionary *) getSessionDictWithEventId:(NSString *)firstEventId {
- (NSDictionary *) getSessionDictWithEventId:(NSString *)firstEventId {
[self updateAccessedLast];
if (_firstEventId == nil) {
_firstEventId = firstEventId;
[self addFirstEventIdToDict];
}
return _sessionDict;
return [_sessionDict copy];
}

- (NSInteger) getForegroundTimeout {
Expand Down Expand Up @@ -162,7 +164,7 @@ - (BOOL) writeSessionToFile {
BOOL result = NO;
if ([paths count] > 0) {
NSString * savePath = [[paths lastObject] stringByAppendingPathComponent:kSessionSavePath];
NSMutableDictionary * sessionDict = [NSMutableDictionary dictionaryWithDictionary:_sessionDict];
NSMutableDictionary * sessionDict = [NSMutableDictionary dictionaryWithDictionary:[_sessionDict copy]];
[sessionDict removeObjectForKey:kSPSessionPreviousId];
[sessionDict removeObjectForKey:kSPSessionStorage];
result = [sessionDict writeToFile:savePath atomically:YES];
Expand All @@ -181,8 +183,8 @@ - (NSDictionary *) getSessionFromFile {
}

- (void) checkSession:(NSTimer *)timer {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSInteger checkTime = [SPUtilities getTimestamp];
dispatch_async(_sessionQueue, ^{
NSNumber *checkTime = [SPUtilities getTimestamp];
NSInteger range = 0;

if (_inBackground) {
Expand All @@ -191,7 +193,7 @@ - (void) checkSession:(NSTimer *)timer {
range = _foregroundTimeout;
}

if (![self isTimeInRangeWithStartTime:_accessedLast andCheckTime:checkTime andRange:range]) {
if (![self isTimeInRangeWithStartTime:_accessedLast.longLongValue andCheckTime:checkTime.longLongValue andRange:range]) {
[self updateSession];
[self updateAccessedLast];
[self updateSessionDict];
Expand All @@ -218,16 +220,18 @@ - (void) updateSessionDict {
[newSessionDict setObject:(_previousSessionId != nil ? _previousSessionId : [NSNull null]) forKey:kSPSessionPreviousId];
[newSessionDict setObject:[NSNumber numberWithInt:(int)_sessionIndex] forKey:kSPSessionIndex];
[newSessionDict setObject:_sessionStorage forKey:kSPSessionStorage];
_sessionDict = newSessionDict;
_sessionDict = [newSessionDict copy];
}

- (void) addFirstEventIdToDict {
[_sessionDict setObject:_firstEventId forKey:kSPSessionFirstEventId];
NSMutableDictionary *dictionary = [_sessionDict mutableCopy];
[dictionary setObject:_firstEventId forKey:kSPSessionFirstEventId];
_sessionDict = dictionary;
}

- (BOOL) isTimeInRangeWithStartTime:(NSInteger)startTime
andCheckTime:(NSInteger)checkTime
andRange:(NSInteger)range {
- (BOOL) isTimeInRangeWithStartTime:(long long)startTime
andCheckTime:(long long)checkTime
andRange:(long long)range {
return startTime > (checkTime - range);
}

Expand Down
2 changes: 1 addition & 1 deletion Snowplow/SPSubject.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,6 @@
* Sets the timestamp value for the geo context
* @param timestamp An NSInteger value
*/
- (void) setGeoTimestamp:(NSInteger)timestamp;
- (void) setGeoTimestamp:(NSNumber *)timestamp;

@end
4 changes: 2 additions & 2 deletions Snowplow/SPSubject.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ - (void) setGeoSpeed:(float)speed {
[_geoLocationDict setObject:[NSNumber numberWithFloat:speed] forKey:kSPGeoSpeed];
}

- (void) setGeoTimestamp:(NSInteger)timestamp {
[_geoLocationDict setObject:[NSNumber numberWithInt:(int)timestamp] forKey:kSPGeoTimestamp];
- (void) setGeoTimestamp:(NSNumber *)timestamp {
[_geoLocationDict setObject:timestamp forKey:kSPGeoTimestamp];
}

@end
2 changes: 1 addition & 1 deletion Snowplow/SPTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ - (void) trackEcommerceEvent:(SPEcommerce *)event {
}
[self addEventWithPayload:[event getPayload] andContext:[event getContexts] andEventId:[event getEventId]];

NSInteger tstamp = [event getTimestamp];
NSNumber *tstamp = [event getTimestamp];
for (SPEcommerceItem * item in [event getItems]) {
[item setTimestamp:tstamp];
[self trackEcommerceItemEvent:item];
Expand Down
2 changes: 1 addition & 1 deletion Snowplow/SPUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
* Returns the timestamp generated at the point it was called.
* @return A double of the timestamp from when the method was called.
*/
+ (NSInteger) getTimestamp;
+ (NSNumber *) getTimestamp;

/**
* Calculates the resolution of the screen in-terms of actual pixels of the device. This doesn't count Retine-pixels which are technically subpixels.
Expand Down
4 changes: 2 additions & 2 deletions Snowplow/SPUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ + (int) getTransactionId {
return arc4random() % (999999 - 100000+1) + 100000;
}

+ (NSInteger) getTimestamp {
+ (NSNumber *) getTimestamp {
NSDate *time = [[NSDate alloc] init];
return [time timeIntervalSince1970] * 1000;
return @([time timeIntervalSince1970] * 1000);
}

+ (NSString *) getResolution {
Expand Down
Loading

0 comments on commit 30636e4

Please sign in to comment.