Skip to content

Commit

Permalink
Merge pull request #26 from adeven/disable_mac_md5_tracking
Browse files Browse the repository at this point in the history
Add method to disable macMd5 tracking
  • Loading branch information
wellle committed Jan 15, 2014
2 parents ec7431c + 5248a5a commit 460fdf8
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 25 deletions.
4 changes: 2 additions & 2 deletions AdjustIO.podspec
Original file line number Diff line number Diff line change
@@ -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}'
Expand Down
1 change: 1 addition & 0 deletions AdjustIo/AIActivityHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions AdjustIo/AIActivityHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
});
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion AdjustIo/AIUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sys/xattr.h>

static NSString * const kBaseUrl = @"https://app.adjust.io";
static NSString * const kClientSdk = @"ios2.1.3";
static NSString * const kClientSdk = @"ios2.1.4";


#pragma mark -
Expand Down
33 changes: 20 additions & 13 deletions AdjustIo/AdjustIo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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));
Expand Down
14 changes: 12 additions & 2 deletions AdjustIo/AdjustIo.m
Original file line number Diff line number Diff line change
Expand Up @@ -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`!"];
Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.3
2.1.4
6 changes: 3 additions & 3 deletions doc/migration.md
Original file line number Diff line number Diff line change
@@ -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]

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 460fdf8

Please sign in to comment.