Skip to content

Commit 24c2c14

Browse files
committed
Merge pull request #62 from adjust/copy_fix
Copy fix
2 parents 5181ac5 + b4c3153 commit 24c2c14

23 files changed

+108
-90
lines changed

Adjust.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = "Adjust"
3-
s.version = "4.0.0"
3+
s.version = "4.0.1"
44
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
55
s.homepage = "http://adjust.com"
66
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
77
s.author = { "Christian Wellenbrock" => "[email protected]" }
8-
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.0" }
8+
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.1" }
99
s.platform = :ios, '4.3'
1010
s.framework = 'SystemConfiguration'
1111
s.weak_framework = 'AdSupport', 'iAd'
12-
s.source_files = 'Adjust/*.{h,m}', 'Adjust/AIAdditions/*.{h,m}'
12+
s.source_files = 'Adjust/*.{h,m}', 'Adjust/ADJAdditions/*.{h,m}'
1313
s.requires_arc = true
1414
end

Adjust.xcodeproj/project.pbxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@
506506
GCC_WARN_UNUSED_FUNCTION = YES;
507507
GCC_WARN_UNUSED_VARIABLE = YES;
508508
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
509-
ONLY_ACTIVE_ARCH = YES;
510509
OTHER_CFLAGS = "-DADJUST_NO_IDA";
511510
SDKROOT = iphoneos;
512511
};

Adjust/ADJActivityHandler.m

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ - (void)setIadDate:(NSDate *)iAdImpressionDate withPurchaseDate:(NSDate *)appPur
158158
if (iAdImpressionDate != nil || appPurchaseDate != nil) {
159159
ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc]
160160
initWithDeviceInfo:self.deviceInfo
161-
andActivityState:self.activityState
162-
andConfig:self.adjustConfig];
161+
activityState:self.activityState
162+
config:self.adjustConfig];
163163

164164
[clickBuilder setClickTime:iAdImpressionDate];
165165
[clickBuilder setPurchaseTime:appPurchaseDate];
@@ -247,12 +247,12 @@ - (void)initInternal:(ADJConfig *)adjustConfig {
247247

248248
- (id<ADJAttributionHandler>) buildAttributionHandler {
249249
ADJPackageBuilder *attributionBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
250-
andActivityState:self.activityState
251-
andConfig:self.adjustConfig];
250+
activityState:self.activityState
251+
config:self.adjustConfig];
252252
ADJActivityPackage *attributionPackage = [attributionBuilder buildAttributionPackage];
253253
id<ADJAttributionHandler> attributionHandler = [ADJAdjustFactory attributionHandlerForActivityHandler:self
254-
withMaxDelay:nil
255-
withAttributionPackage:attributionPackage];
254+
withMaxDelay:nil
255+
withAttributionPackage:attributionPackage];
256256

257257
return attributionHandler;
258258
}
@@ -312,8 +312,8 @@ - (void)startInternal {
312312
self.activityState.lastActivity = now;
313313
[self writeActivityState];
314314
[self.logger info:@"Processed Subsession %d of Session %d",
315-
self.activityState.subsessionCount,
316-
self.activityState.sessionCount];
315+
self.activityState.subsessionCount,
316+
self.activityState.sessionCount];
317317
}
318318

319319
if (self.attribution == nil || self.activityState.askingAttribution) {
@@ -353,8 +353,8 @@ - (void)eventInternal:(ADJEvent *)event
353353

354354
// create and populate event package
355355
ADJPackageBuilder *eventBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
356-
andActivityState:self.activityState
357-
andConfig:self.adjustConfig];
356+
activityState:self.activityState
357+
config:self.adjustConfig];
358358

359359
ADJActivityPackage *eventPackage = [eventBuilder buildEventPackage:event];
360360
[self.packageHandler addPackage:eventPackage];
@@ -399,8 +399,8 @@ - (void) appWillOpenUrlInternal:(NSURL *)url {
399399

400400

401401
ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
402-
andActivityState:self.activityState
403-
andConfig:self.adjustConfig];
402+
activityState:self.activityState
403+
config:self.adjustConfig];
404404
clickBuilder.deeplinkParameters = adjustDeepLinks;
405405
clickBuilder.attribution = attribution;
406406

@@ -409,8 +409,8 @@ - (void) appWillOpenUrlInternal:(NSURL *)url {
409409
}
410410

411411
- (BOOL) trySetAttributionDeeplink:(ADJAttribution *)attribution
412-
withKey:(NSString *)key
413-
withValue:(NSString*)value {
412+
withKey:(NSString *)key
413+
withValue:(NSString*)value {
414414

415415
if ([key isEqualToString:@"tracker"]) {
416416
attribution.trackerName = value;
@@ -491,8 +491,8 @@ - (void)readAttribution {
491491

492492
- (void)transferSessionPackage {
493493
ADJPackageBuilder *sessionBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
494-
andActivityState:self.activityState
495-
andConfig:self.adjustConfig];
494+
activityState:self.activityState
495+
config:self.adjustConfig];
496496
ADJActivityPackage *sessionPackage = [sessionBuilder buildSessionPackage];
497497
[self.packageHandler addPackage:sessionPackage];
498498
[self.packageHandler sendFirstPackage];
@@ -503,9 +503,9 @@ - (void)transferSessionPackage {
503503
- (void)startTimer {
504504
if (self.timer == nil) {
505505
self.timer = [ADJTimer timerWithInterval:kTimerInterval
506-
leeway:kTimerLeeway
507-
queue:self.internalQueue
508-
block:^{ [self timerFired]; }];
506+
leeway:kTimerLeeway
507+
queue:self.internalQueue
508+
block:^{ [self timerFired]; }];
509509
}
510510
[self.timer resume];
511511
}
@@ -578,7 +578,7 @@ - (BOOL) checkTransactionId:(NSString *)transactionId {
578578
[self.logger verbose:@"Found transaction ID in %@", self.activityState.transactionIds];
579579
return NO; // transaction ID found -> used already
580580
}
581-
581+
582582
[self.activityState addTransactionId:transactionId];
583583
[self.logger verbose:@"Added transaction ID %@", self.activityState.transactionIds];
584584
// activity state will get written by caller

Adjust/ADJActivityState.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ -(id)copyWithZone:(NSZone *)zone
138138
copy.askingAttribution = self.askingAttribution;
139139
// transactionIds not copied
140140
}
141-
141+
142142
return copy;
143143
}
144144

Adjust/ADJAdditions/NSString+ADJAdditions.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ - (NSString *)adjSha1 {
4343

4444
-(NSString *)adjUrlEncode {
4545
return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
46-
NULL,
47-
(CFStringRef)self,
48-
NULL,
49-
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
50-
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
46+
NULL,
47+
(CFStringRef)self,
48+
NULL,
49+
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
50+
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
5151
}
5252

5353
- (NSString *)adjRemoveColons {
@@ -63,7 +63,7 @@ + (NSString *)adjJoin:(NSString *)first, ... {
6363
NSString *capitalized = iter.capitalizedString;
6464
result = [result stringByAppendingString:capitalized];
6565
}
66-
66+
6767
va_end(strings);
6868
return result;
6969
}
@@ -72,7 +72,7 @@ + (BOOL) adjIsEqual:(NSString *)first toString:(NSString *)second {
7272
if (first == nil && second == nil) {
7373
return YES;
7474
}
75-
75+
7676
return [first isEqualToString:second];
7777
}
7878

Adjust/ADJAdditions/UIDevice+ADJAdditions.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ - (void) adjSetIad:(ADJActivityHandler *) activityHandler{
182182
id ADClientSharedClientInstance = [ADClientClass performSelector:sharedClientSelector];
183183

184184
[ADClientSharedClientInstance performSelector:iadDateSelector
185-
withObject:^(NSDate *appPurchaseDate, NSDate *iAdImpressionDate) {
186-
[activityHandler setIadDate:iAdImpressionDate withPurchaseDate:appPurchaseDate];
187-
}];
185+
withObject:^(NSDate *appPurchaseDate, NSDate *iAdImpressionDate) {
186+
[activityHandler setIadDate:iAdImpressionDate withPurchaseDate:appPurchaseDate];
187+
}];
188188
#pragma clang diagnostic pop
189189
}
190190
@catch (NSException *exception) {

Adjust/ADJAttribution.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import <Foundation/Foundation.h>
1010

11-
@interface ADJAttribution : NSObject <NSCoding>
11+
@interface ADJAttribution : NSObject <NSCoding, NSCopying>
1212

1313
// the following attributes are only set when error is nil
1414
// (when activity was tracked successfully and response could be parsed)

Adjust/ADJAttribution.m

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ - (NSDictionary *)dictionary {
7373
if (self.network != nil) {
7474
[responseDataDic setObject:self.network forKey:@"network"];
7575
}
76-
76+
7777
if (self.campaign != nil) {
7878
[responseDataDic setObject:self.campaign forKey:@"campaign"];
7979
}
80-
80+
8181
if (self.adgroup != nil) {
8282
[responseDataDic setObject:self.adgroup forKey:@"adgroup"];
8383
}
84-
84+
8585
if (self.creative != nil) {
8686
[responseDataDic setObject:self.creative forKey:@"creative"];
8787
}
@@ -113,6 +113,25 @@ - (NSUInteger)hash {
113113
return [self.trackerName hash];
114114
}
115115

116+
#pragma mark - NSCopying
117+
118+
-(id)copyWithZone:(NSZone *)zone
119+
{
120+
ADJAttribution* copy = [[[self class] allocWithZone:zone] init];
121+
122+
if (copy) {
123+
copy.trackerToken = [self.trackerToken copyWithZone:zone];
124+
copy.trackerName = [self.trackerName copyWithZone:zone];
125+
copy.network = [self.network copyWithZone:zone];
126+
copy.campaign = [self.campaign copyWithZone:zone];
127+
copy.adgroup = [self.adgroup copyWithZone:zone];
128+
copy.creative = [self.creative copyWithZone:zone];
129+
}
130+
131+
return copy;
132+
}
133+
134+
116135
#pragma mark NSCoding
117136

118137
- (id)initWithCoder:(NSCoder *)decoder {

Adjust/ADJAttributionHandler.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ @implementation ADJAttributionHandler
3737
{
3838
return [[ADJAttributionHandler alloc] initWithActivityHandler:activityHandler
3939
withMaxDelay:milliseconds
40-
withAttributionPackage:attributionPackage];
40+
withAttributionPackage:attributionPackage];
4141
}
4242

4343
- (id)initWithActivityHandler:(id<ADJActivityHandler>) activityHandler
@@ -118,8 +118,8 @@ -(void) getAttributionInternal {
118118
NSURLResponse *urlResponse = nil;
119119

120120
NSData *response = [NSURLConnection sendSynchronousRequest:request
121-
returningResponse:&urlResponse
122-
error:&requestError];
121+
returningResponse:&urlResponse
122+
error:&requestError];
123123
// connection error
124124
if (requestError != nil) {
125125
[self.logger error:@"Failed to get attribution. (%@)", requestError.localizedDescription];
@@ -169,7 +169,7 @@ - (NSURL *)url {
169169
NSString *relativePath = [NSString stringWithFormat:@"%@?%@", self.attributionPackage.path, parameters];
170170
NSURL *baseUrl = [NSURL URLWithString:ADJUtil.baseUrl];
171171
NSURL *url = [NSURL URLWithString:relativePath relativeToURL:baseUrl];
172-
172+
173173
return url;
174174
}
175175

Adjust/ADJConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @param appToken The App Token of your app. This unique identifier can
3939
* be found it in your dashboard at http://adjust.com and should always
4040
* be 12 characters long.
41-
* @param environment The current environment your app. We use this environment to
41+
* @param environment The current environment your app. We use this environment to
4242
* distinguish between real traffic and artificial traffic from test devices.
4343
* It is very important that you keep this value meaningful at all times!
4444
* Especially if you are tracking revenue.
@@ -58,7 +58,7 @@
5858
/**
5959
* Disable macMd5 tracking if your privacy constraints require it.
6060
*
61-
* @param macMd5TrackingEnabled Enable or disable tracking of
61+
* @param macMd5TrackingEnabled Enable or disable tracking of
6262
* the MD5 hash of the MAC address
6363
*/
6464
@property (nonatomic, assign) BOOL macMd5TrackingEnabled;

0 commit comments

Comments
 (0)