Skip to content
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
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Adjust"
s.version = "4.0.3"
s.version = "4.0.4"
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
s.homepage = "http://adjust.com"
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
s.author = { "Christian Wellenbrock" => "welle@adjust.com" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.3" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.4" }
s.platform = :ios, '4.3'
s.framework = 'SystemConfiguration'
s.weak_framework = 'AdSupport', 'iAd'
Expand Down
6 changes: 4 additions & 2 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ - (BOOL)updateAttribution:(ADJAttribution *)attribution {
}

- (void)launchAttributionDelegate{
if (self.delegate == nil) {
return;
}
if (![self.delegate respondsToSelector:@selector(adjustAttributionChanged:)]) {
[self.logger warn:@"Delegate can't be launched because it does not implement AdjustDelegate"];
return;
Expand Down Expand Up @@ -356,8 +359,6 @@ - (void)eventInternal:(ADJEvent *)event
ADJPackageBuilder *eventBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
activityState:self.activityState
config:self.adjustConfig];
[self setIadDate:[NSDate date] withPurchaseDate:[NSDate date]];

ADJActivityPackage *eventPackage = [eventBuilder buildEventPackage:event];
[self.packageHandler addPackage:eventPackage];

Expand Down Expand Up @@ -480,6 +481,7 @@ - (void)writeAttribution {
}

- (void)readActivityState {
[NSKeyedUnarchiver setClass:[ADJActivityState class] forClassName:@"AIActivityState"];
self.activityState = [ADJUtil readObject:kActivityStateFilename
objectName:@"Activity state"
class:[ADJActivityState class]];
Expand Down
20 changes: 14 additions & 6 deletions Adjust/ADJActivityState.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,33 @@ - (id)initWithCoder:(NSCoder *)decoder {
self.timeSpent = [decoder decodeDoubleForKey:@"timeSpent"];
self.createdAt = [decoder decodeDoubleForKey:@"createdAt"];
self.lastActivity = [decoder decodeDoubleForKey:@"lastActivity"];
self.uuid = [decoder decodeObjectForKey:@"uuid"];
self.transactionIds = [decoder decodeObjectForKey:@"transactionIds"];
self.enabled = [decoder decodeBoolForKey:@"enabled"];
self.askingAttribution = [decoder decodeBoolForKey:@"askingAttribution"];

// default values for migrating devices
if ([decoder containsValueForKey:@"uuid"]) {
self.uuid = [decoder decodeObjectForKey:@"uuid"];
}

if (self.uuid == nil) {
self.uuid = [UIDevice.currentDevice adjCreateUuid];
}

if ([decoder containsValueForKey:@"transactionIds"]) {
self.transactionIds = [decoder decodeObjectForKey:@"transactionIds"];
}

if (self.transactionIds == nil) {
self.transactionIds = [NSMutableArray arrayWithCapacity:kTransactionIdCount];
}

if (![decoder containsValueForKey:@"enabled"]) {
if ([decoder containsValueForKey:@"enabled"]) {
self.enabled = [decoder decodeBoolForKey:@"enabled"];
} else {
self.enabled = YES;
}

if (![decoder containsValueForKey:@"askingAttribution"]) {
if ([decoder containsValueForKey:@"askingAttribution"]) {
self.askingAttribution = [decoder decodeBoolForKey:@"askingAttribution"];
} else {
self.askingAttribution = NO;
}

Expand Down
1 change: 1 addition & 0 deletions Adjust/ADJPackageHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ - (void)sendNextInternal {
#pragma mark - private
- (void)readPackageQueue {
@try {
[NSKeyedUnarchiver setClass:[ADJActivityPackage class] forClassName:@"AIActivityPackage"];
NSString *filename = self.packageQueueFilename;
id object = [NSKeyedUnarchiver unarchiveObjectWithFile:filename];
if ([object isKindOfClass:[NSArray class]]) {
Expand Down
12 changes: 6 additions & 6 deletions Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@
#include <sys/xattr.h>

static NSString * const kBaseUrl = @"https://app.adjust.com";
static NSString * const kClientSdk = @"ios4.0.3";
static NSString * const kClientSdk = @"ios4.0.4";

static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z";
static NSDateFormatter *dateFormat;

#pragma mark -
@implementation ADJUtil

+ (void) initialize {
dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:kDateFormat];
}

+ (NSString *)baseUrl {
return kBaseUrl;
}
Expand Down Expand Up @@ -80,11 +85,6 @@ + (NSString *)formatSeconds1970:(double) value {


+ (NSString *)formatDate:(NSDate *) value {
if (dateFormat == nil) {
dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:kDateFormat];
}

return [dateFormat stringFromDate:value];
}

Expand Down
5 changes: 1 addition & 4 deletions AdjustTests/ADJActivityHandlerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (void)testFirstRun
ADJActivityPackage *activityPackage = (ADJActivityPackage *) self.packageHandlerMock.packageQueue[0];

// check the Sdk version is being tested
XCTAssertEqual(@"ios4.0.3", activityPackage.clientSdk, @"%@", activityPackage.extendedString);
XCTAssertEqual(@"ios4.0.4", activityPackage.clientSdk, @"%@", activityPackage.extendedString);

// check the server url
XCTAssertEqual(@"https://app.adjust.com", ADJUtil.baseUrl);
Expand Down Expand Up @@ -177,9 +177,6 @@ - (void)testFirstRun
// has delegate
XCTAssertEqual(1, [(NSString *)parameters[@"needs_attribution_data"] intValue], @"%@", activityPackage.extendedString);

// network type
XCTAssertNotNil((NSString *)parameters[@"network_type"], @"%@", activityPackage.extendedString);

// os name
XCTAssertEqual(@"ios", parameters[@"os_name"], @"%@", activityPackage.extendedString);

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you're using [CocoaPods][cocoapods], you can add the following line to your
`Podfile` and continue with [step 3](#step3):

```ruby
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.0.3'
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.0.4'
```

### 1. Get the SDK
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3
4.0.4
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your adjust SDK for iOS to v4.0.3 from v3.4.0
## Migrate your adjust SDK for iOS to v4.0.4 from v3.4.0

### Initial setup

Expand Down