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
6 changes: 3 additions & 3 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = "Adjust"
s.version = "4.0.0"
s.version = "4.0.1"
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.0" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.1" }
s.platform = :ios, '4.3'
s.framework = 'SystemConfiguration'
s.weak_framework = 'AdSupport', 'iAd'
s.source_files = 'Adjust/*.{h,m}', 'Adjust/AIAdditions/*.{h,m}'
s.source_files = 'Adjust/*.{h,m}', 'Adjust/ADJAdditions/*.{h,m}'
s.requires_arc = true
end
1 change: 0 additions & 1 deletion Adjust.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DADJUST_NO_IDA";
SDKROOT = iphoneos;
};
Expand Down
40 changes: 20 additions & 20 deletions Adjust/ADJActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ - (void)setIadDate:(NSDate *)iAdImpressionDate withPurchaseDate:(NSDate *)appPur
if (iAdImpressionDate != nil || appPurchaseDate != nil) {
ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc]
initWithDeviceInfo:self.deviceInfo
andActivityState:self.activityState
andConfig:self.adjustConfig];
activityState:self.activityState
config:self.adjustConfig];

[clickBuilder setClickTime:iAdImpressionDate];
[clickBuilder setPurchaseTime:appPurchaseDate];
Expand Down Expand Up @@ -247,12 +247,12 @@ - (void)initInternal:(ADJConfig *)adjustConfig {

- (id<ADJAttributionHandler>) buildAttributionHandler {
ADJPackageBuilder *attributionBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
andActivityState:self.activityState
andConfig:self.adjustConfig];
activityState:self.activityState
config:self.adjustConfig];
ADJActivityPackage *attributionPackage = [attributionBuilder buildAttributionPackage];
id<ADJAttributionHandler> attributionHandler = [ADJAdjustFactory attributionHandlerForActivityHandler:self
withMaxDelay:nil
withAttributionPackage:attributionPackage];
withMaxDelay:nil
withAttributionPackage:attributionPackage];

return attributionHandler;
}
Expand Down Expand Up @@ -312,8 +312,8 @@ - (void)startInternal {
self.activityState.lastActivity = now;
[self writeActivityState];
[self.logger info:@"Processed Subsession %d of Session %d",
self.activityState.subsessionCount,
self.activityState.sessionCount];
self.activityState.subsessionCount,
self.activityState.sessionCount];
}

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

// create and populate event package
ADJPackageBuilder *eventBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
andActivityState:self.activityState
andConfig:self.adjustConfig];
activityState:self.activityState
config:self.adjustConfig];

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


ADJPackageBuilder *clickBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
andActivityState:self.activityState
andConfig:self.adjustConfig];
activityState:self.activityState
config:self.adjustConfig];
clickBuilder.deeplinkParameters = adjustDeepLinks;
clickBuilder.attribution = attribution;

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

- (BOOL) trySetAttributionDeeplink:(ADJAttribution *)attribution
withKey:(NSString *)key
withValue:(NSString*)value {
withKey:(NSString *)key
withValue:(NSString*)value {

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

- (void)transferSessionPackage {
ADJPackageBuilder *sessionBuilder = [[ADJPackageBuilder alloc] initWithDeviceInfo:self.deviceInfo
andActivityState:self.activityState
andConfig:self.adjustConfig];
activityState:self.activityState
config:self.adjustConfig];
ADJActivityPackage *sessionPackage = [sessionBuilder buildSessionPackage];
[self.packageHandler addPackage:sessionPackage];
[self.packageHandler sendFirstPackage];
Expand All @@ -503,9 +503,9 @@ - (void)transferSessionPackage {
- (void)startTimer {
if (self.timer == nil) {
self.timer = [ADJTimer timerWithInterval:kTimerInterval
leeway:kTimerLeeway
queue:self.internalQueue
block:^{ [self timerFired]; }];
leeway:kTimerLeeway
queue:self.internalQueue
block:^{ [self timerFired]; }];
}
[self.timer resume];
}
Expand Down Expand Up @@ -578,7 +578,7 @@ - (BOOL) checkTransactionId:(NSString *)transactionId {
[self.logger verbose:@"Found transaction ID in %@", self.activityState.transactionIds];
return NO; // transaction ID found -> used already
}

[self.activityState addTransactionId:transactionId];
[self.logger verbose:@"Added transaction ID %@", self.activityState.transactionIds];
// activity state will get written by caller
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJActivityState.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ -(id)copyWithZone:(NSZone *)zone
copy.askingAttribution = self.askingAttribution;
// transactionIds not copied
}

return copy;
}

Expand Down
14 changes: 7 additions & 7 deletions Adjust/ADJAdditions/NSString+ADJAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ - (NSString *)adjSha1 {

-(NSString *)adjUrlEncode {
return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(
NULL,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
NULL,
(CFStringRef)self,
NULL,
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
}

- (NSString *)adjRemoveColons {
Expand All @@ -63,7 +63,7 @@ + (NSString *)adjJoin:(NSString *)first, ... {
NSString *capitalized = iter.capitalizedString;
result = [result stringByAppendingString:capitalized];
}

va_end(strings);
return result;
}
Expand All @@ -72,7 +72,7 @@ + (BOOL) adjIsEqual:(NSString *)first toString:(NSString *)second {
if (first == nil && second == nil) {
return YES;
}

return [first isEqualToString:second];
}

Expand Down
6 changes: 3 additions & 3 deletions Adjust/ADJAdditions/UIDevice+ADJAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ - (void) adjSetIad:(ADJActivityHandler *) activityHandler{
id ADClientSharedClientInstance = [ADClientClass performSelector:sharedClientSelector];

[ADClientSharedClientInstance performSelector:iadDateSelector
withObject:^(NSDate *appPurchaseDate, NSDate *iAdImpressionDate) {
[activityHandler setIadDate:iAdImpressionDate withPurchaseDate:appPurchaseDate];
}];
withObject:^(NSDate *appPurchaseDate, NSDate *iAdImpressionDate) {
[activityHandler setIadDate:iAdImpressionDate withPurchaseDate:appPurchaseDate];
}];
#pragma clang diagnostic pop
}
@catch (NSException *exception) {
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJAttribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <Foundation/Foundation.h>

@interface ADJAttribution : NSObject <NSCoding>
@interface ADJAttribution : NSObject <NSCoding, NSCopying>

// the following attributes are only set when error is nil
// (when activity was tracked successfully and response could be parsed)
Expand Down
25 changes: 22 additions & 3 deletions Adjust/ADJAttribution.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ - (NSDictionary *)dictionary {
if (self.network != nil) {
[responseDataDic setObject:self.network forKey:@"network"];
}

if (self.campaign != nil) {
[responseDataDic setObject:self.campaign forKey:@"campaign"];
}

if (self.adgroup != nil) {
[responseDataDic setObject:self.adgroup forKey:@"adgroup"];
}

if (self.creative != nil) {
[responseDataDic setObject:self.creative forKey:@"creative"];
}
Expand Down Expand Up @@ -113,6 +113,25 @@ - (NSUInteger)hash {
return [self.trackerName hash];
}

#pragma mark - NSCopying

-(id)copyWithZone:(NSZone *)zone
{
ADJAttribution* copy = [[[self class] allocWithZone:zone] init];

if (copy) {
copy.trackerToken = [self.trackerToken copyWithZone:zone];
copy.trackerName = [self.trackerName copyWithZone:zone];
copy.network = [self.network copyWithZone:zone];
copy.campaign = [self.campaign copyWithZone:zone];
copy.adgroup = [self.adgroup copyWithZone:zone];
copy.creative = [self.creative copyWithZone:zone];
}

return copy;
}


#pragma mark NSCoding

- (id)initWithCoder:(NSCoder *)decoder {
Expand Down
8 changes: 4 additions & 4 deletions Adjust/ADJAttributionHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ @implementation ADJAttributionHandler
{
return [[ADJAttributionHandler alloc] initWithActivityHandler:activityHandler
withMaxDelay:milliseconds
withAttributionPackage:attributionPackage];
withAttributionPackage:attributionPackage];
}

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

NSData *response = [NSURLConnection sendSynchronousRequest:request
returningResponse:&urlResponse
error:&requestError];
returningResponse:&urlResponse
error:&requestError];
// connection error
if (requestError != nil) {
[self.logger error:@"Failed to get attribution. (%@)", requestError.localizedDescription];
Expand Down Expand Up @@ -169,7 +169,7 @@ - (NSURL *)url {
NSString *relativePath = [NSString stringWithFormat:@"%@?%@", self.attributionPackage.path, parameters];
NSURL *baseUrl = [NSURL URLWithString:ADJUtil.baseUrl];
NSURL *url = [NSURL URLWithString:relativePath relativeToURL:baseUrl];

return url;
}

Expand Down
4 changes: 2 additions & 2 deletions Adjust/ADJConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @param appToken The App Token of your app. This unique identifier can
* be found it in your dashboard at http://adjust.com and should always
* be 12 characters long.
* @param environment The current environment your app. We use this environment to
* @param environment The current environment your app. We use this environment to
* distinguish between real traffic and artificial traffic from test devices.
* It is very important that you keep this value meaningful at all times!
* Especially if you are tracking revenue.
Expand All @@ -58,7 +58,7 @@
/**
* Disable macMd5 tracking if your privacy constraints require it.
*
* @param macMd5TrackingEnabled Enable or disable tracking of
* @param macMd5TrackingEnabled Enable or disable tracking of
* the MD5 hash of the MAC address
*/
@property (nonatomic, assign) BOOL macMd5TrackingEnabled;
Expand Down
6 changes: 3 additions & 3 deletions Adjust/ADJConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
@implementation ADJConfig

+ (ADJConfig *) configWithAppToken:(NSString *)appToken
environment:(NSString *)environment {
environment:(NSString *)environment {
return [[ADJConfig alloc] initWithAppToken:appToken environment:environment];
}

- (id) initWithAppToken:(NSString *)appToken
environment:(NSString *)environment
environment:(NSString *)environment
{
self = [super init];
if (self == nil) return nil;
Expand Down Expand Up @@ -91,7 +91,7 @@ -(id)copyWithZone:(NSZone *)zone
copy.hasDelegate = self.hasDelegate;
// adjust delegate not copied
}

return copy;
}

Expand Down
4 changes: 2 additions & 2 deletions Adjust/ADJDeviceInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ - (NSString *)getNetworkStatus {
*/
return kWWAN;
}

return nil;
}

Expand Down Expand Up @@ -146,7 +146,7 @@ -(id)copyWithZone:(NSZone *)zone
copy.mobileCountryCode = [self.mobileCountryCode copyWithZone:zone];
copy.mobileNetworkCode = [self.mobileNetworkCode copyWithZone:zone];
}

return copy;
}

Expand Down
10 changes: 5 additions & 5 deletions Adjust/ADJEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

@property (nonatomic, copy) NSString* eventToken;
@property (nonatomic, copy) NSNumber* revenue;
@property (nonatomic, copy) NSMutableDictionary* callbackParameters;
@property (nonatomic, copy) NSMutableDictionary* partnerParameters;
@property (nonatomic, retain) NSMutableDictionary* callbackParameters;
@property (nonatomic, retain) NSMutableDictionary* partnerParameters;
@property (nonatomic, copy) NSString* transactionId;
@property (nonatomic, copy) NSString* currency;

/**
* Create Event object with Event Token.
*
* @param event Event token that is created in the dashboard
* @param event Event token that is created in the dashboard
* at http://adjust.com and should be six characters long.
*/
+ (ADJEvent *)eventWithEventToken:(NSString *)eventToken;
Expand All @@ -39,7 +39,7 @@
*
*/
- (void) addCallbackParameter:(NSString *)key
value:(NSString *)value;
value:(NSString *)value;

/**
* Add a key-pair to be fowarded to a partner.
Expand All @@ -49,7 +49,7 @@
*
*/
- (void) addPartnerParameter:(NSString *)key
value:(NSString *)value;
value:(NSString *)value;

/**
* Set the revenue and associated currency of the event.
Expand Down
6 changes: 3 additions & 3 deletions Adjust/ADJEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ - (id) initWithEventToken:(NSString *)eventToken {
}

- (void) addCallbackParameter:(NSString *)key
value:(NSString *)value {
value:(NSString *)value {
if (self.callbackParameters == nil) {
self.callbackParameters = [[NSMutableDictionary alloc] init];
}
Expand All @@ -44,7 +44,7 @@ - (void) addCallbackParameter:(NSString *)key
}

- (void) addPartnerParameter:(NSString *)key
value:(NSString *)value {
value:(NSString *)value {
if (self.partnerParameters == nil) {
self.partnerParameters = [[NSMutableDictionary alloc] init];
}
Expand Down Expand Up @@ -105,7 +105,7 @@ -(id)copyWithZone:(NSZone *)zone
copy.currency = [self.currency copyWithZone:zone];
}
return copy;

}

@end
Loading