diff --git a/AdjustIO.podspec b/AdjustIO.podspec index e0fac1844..957351d91 100644 --- a/AdjustIO.podspec +++ b/AdjustIO.podspec @@ -1,11 +1,11 @@ Pod::Spec.new do |s| s.name = "AdjustIO" - s.version = "2.1.3" + s.version = "2.1.4" s.summary = "This is the iOS SDK of AdjustIo. You can read more about it at http://adjust.io." s.homepage = "http://adjust.io" s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } s.author = { "Christian Wellenbrock" => "welle@adeven.com" } - s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.3" } + s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.4" } s.platform = :ios, '4.3' s.framework = 'AdSupport', 'SystemConfiguration' s.source_files = 'AdjustIo/*.{h,m}', 'AdjustIo/AIAdditions/*.{h,m}' diff --git a/AdjustIo/AIActivityHandler.h b/AdjustIo/AIActivityHandler.h index 0de2f7a40..ea53ea96b 100644 --- a/AdjustIo/AIActivityHandler.h +++ b/AdjustIo/AIActivityHandler.h @@ -12,6 +12,7 @@ @property (nonatomic, copy) NSString *environment; @property (nonatomic, assign) BOOL bufferEvents; +@property (nonatomic, assign) BOOL trackMacMd5; + (AIActivityHandler *)handlerWithAppToken:(NSString *)appToken; - (id)initWithAppToken:(NSString *)appToken; diff --git a/AdjustIo/AIActivityHandler.m b/AdjustIo/AIActivityHandler.m index 2441cede6..0701a2726 100644 --- a/AdjustIo/AIActivityHandler.m +++ b/AdjustIo/AIActivityHandler.m @@ -59,9 +59,12 @@ - (id)initWithAppToken:(NSString *)yourAppToken { [self addNotificationObserver]; self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL); - self.environment = @"unknown"; // default value self.clientSdk = AIUtil.clientSdk; + // default values + self.environment = @"unknown"; + self.trackMacMd5 = YES; + dispatch_async(self.internalQueue, ^{ [self initInternal:yourAppToken]; }); @@ -330,12 +333,15 @@ - (void)injectGeneralAttributes:(AIPackageBuilder *)builder { builder.userAgent = self.userAgent; builder.clientSdk = self.clientSdk; builder.appToken = self.appToken; - builder.macShortMd5 = self.macShortMd5; builder.macSha1 = self.macSha1; builder.trackingEnabled = self.trackingEnabled; builder.idForAdvertisers = self.idForAdvertisers; builder.fbAttributionId = self.fbAttributionId; builder.environment = self.environment; + + if (self.trackMacMd5) { + builder.macShortMd5 = self.macShortMd5; + } } # pragma mark - timer diff --git a/AdjustIo/AIUtil.m b/AdjustIo/AIUtil.m index b06e391a8..34e8451e9 100644 --- a/AdjustIo/AIUtil.m +++ b/AdjustIo/AIUtil.m @@ -13,7 +13,7 @@ #include static NSString * const kBaseUrl = @"https://app.adjust.io"; -static NSString * const kClientSdk = @"ios2.1.3"; +static NSString * const kClientSdk = @"ios2.1.4"; #pragma mark - diff --git a/AdjustIo/AdjustIo.h b/AdjustIo/AdjustIo.h index b8f8dbd57..e241f0dd4 100644 --- a/AdjustIo/AdjustIo.h +++ b/AdjustIo/AdjustIo.h @@ -67,6 +67,23 @@ static NSString * const AIEnvironmentProduction = @"production"; + (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken; + (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken withParameters:(NSDictionary *)parameters; +/** + * Change the verbosity of AdjustIo's logs. + * + * You can increase or reduce the amount of logs from AdjustIo by passing + * one of the following parameters. Use Log.ASSERT to disable all logging. + * + * @param logLevel The desired minimum log level (default: info) + * Must be one of the following: + * - AILogLevelVerbose (enable all logging) + * - AILogLevelDebug (enable more logging) + * - AILogLevelInfo (the default) + * - AILogLevelWarn (disable info logging) + * - AILogLevelError (disable warnings as well) + * - AILogLevelAssert (disable errors as well) + */ ++ (void)setLogLevel:(AILogLevel)logLevel; + /** * Set the tracking environment to sandbox or production. * @@ -88,21 +105,11 @@ static NSString * const AIEnvironmentProduction = @"production"; + (void)setEventBufferingEnabled:(BOOL)enabled; /** - * Change the verbosity of AdjustIo's logs. - * - * You can increase or reduce the amount of logs from AdjustIo by passing - * one of the following parameters. Use Log.ASSERT to disable all logging. + * Enable or disable tracking of the MD5 hash of the MAC address * - * @param logLevel The desired minimum log level (default: info) - * Must be one of the following: - * - AILogLevelVerbose (enable all logging) - * - AILogLevelDebug (enable more logging) - * - AILogLevelInfo (the default) - * - AILogLevelWarn (disable info logging) - * - AILogLevelError (disable warnings as well) - * - AILogLevelAssert (disable errors as well) + * Disable macMd5 tracking if your privacy constraints require it. */ -+ (void)setLogLevel:(AILogLevel)logLevel; ++ (void)setMacMd5TrackingEnabled:(BOOL)enabled; // Special method used by SDK wrappers such as Adobe Air SDK. + (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated)); diff --git a/AdjustIo/AdjustIo.m b/AdjustIo/AdjustIo.m index 6351e6cf2..9799e0d73 100644 --- a/AdjustIo/AdjustIo.m +++ b/AdjustIo/AdjustIo.m @@ -51,6 +51,10 @@ + (void)trackRevenue:(double)amountInCents [activityHandler trackRevenue:amountInCents forEvent:eventToken withParameters:parameters]; } ++ (void)setLogLevel:(AILogLevel)logLevel { + [AILogger setLogLevel:logLevel]; +} + + (void)setEnvironment:(NSString *)environment { if (activityHandler == nil) { [AILogger error:@"Please call `setEnvironment` after `appDidLaunch`!"]; @@ -77,8 +81,14 @@ + (void)setEventBufferingEnabled:(BOOL)enabled { if (enabled) [AILogger info:@"Event buffering is enabled"]; } -+ (void)setLogLevel:(AILogLevel)logLevel { - [AILogger setLogLevel:logLevel]; ++ (void)setMacMd5TrackingEnabled:(BOOL)enabled { + if (activityHandler == nil) { + [AILogger error:@"Please call `setMacMd5TrackingEnabled` after `appDidLaunch`!"]; + return; + } + + activityHandler.trackMacMd5 = enabled; + [AILogger info:@"Tracking of macMd5 is %@", enabled ? @"enabled" : @"disabled"]; } @end diff --git a/README.md b/README.md index 39be052fb..7f2ded24c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue with [step 3](#step3): ```ruby -pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.3' +pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.4' ``` ### 1. Get the SDK diff --git a/VERSION b/VERSION index ac2cdeba0..7d2ed7c70 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.3 +2.1.4 diff --git a/doc/migration.md b/doc/migration.md index 85805f0f3..8d908635f 100644 --- a/doc/migration.md +++ b/doc/migration.md @@ -1,7 +1,7 @@ -## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.3 +## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.4 1. Delete the old `AdjustIo` source folder from your Xcode project. Download - version v2.1.3 and drag the new folder into your Xcode project. + version v2.1.4 and drag the new folder into your Xcode project. ![][drag] @@ -55,7 +55,7 @@ 2. The `appDidLaunch` method now expects your App Token instead of your App ID. You can find your App Token in your [dashboard]. -2. The AdjustIo SDK for iOS 2.1.3 uses [ARC][arc]. If you haven't done already, +2. The AdjustIo SDK for iOS 2.1.4 uses [ARC][arc]. If you haven't done already, we recommend [transitioning your project to use ARC][transition] as well. If you don't want to use ARC, you have to enable ARC for all files of the AdjustIo SDK. Please consult the [README] for details.