Skip to content

Commit 460fdf8

Browse files
committed
Merge pull request #26 from adeven/disable_mac_md5_tracking
Add method to disable macMd5 tracking
2 parents ec7431c + 5248a5a commit 460fdf8

File tree

9 files changed

+49
-25
lines changed

9 files changed

+49
-25
lines changed

AdjustIO.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "AdjustIO"
3-
s.version = "2.1.3"
3+
s.version = "2.1.4"
44
s.summary = "This is the iOS SDK of AdjustIo. You can read more about it at http://adjust.io."
55
s.homepage = "http://adjust.io"
66
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
77
s.author = { "Christian Wellenbrock" => "[email protected]" }
8-
s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.3" }
8+
s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v2.1.4" }
99
s.platform = :ios, '4.3'
1010
s.framework = 'AdSupport', 'SystemConfiguration'
1111
s.source_files = 'AdjustIo/*.{h,m}', 'AdjustIo/AIAdditions/*.{h,m}'

AdjustIo/AIActivityHandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
@property (nonatomic, copy) NSString *environment;
1414
@property (nonatomic, assign) BOOL bufferEvents;
15+
@property (nonatomic, assign) BOOL trackMacMd5;
1516

1617
+ (AIActivityHandler *)handlerWithAppToken:(NSString *)appToken;
1718
- (id)initWithAppToken:(NSString *)appToken;

AdjustIo/AIActivityHandler.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ - (id)initWithAppToken:(NSString *)yourAppToken {
5959

6060
[self addNotificationObserver];
6161
self.internalQueue = dispatch_queue_create(kInternalQueueName, DISPATCH_QUEUE_SERIAL);
62-
self.environment = @"unknown"; // default value
6362
self.clientSdk = AIUtil.clientSdk;
6463

64+
// default values
65+
self.environment = @"unknown";
66+
self.trackMacMd5 = YES;
67+
6568
dispatch_async(self.internalQueue, ^{
6669
[self initInternal:yourAppToken];
6770
});
@@ -330,12 +333,15 @@ - (void)injectGeneralAttributes:(AIPackageBuilder *)builder {
330333
builder.userAgent = self.userAgent;
331334
builder.clientSdk = self.clientSdk;
332335
builder.appToken = self.appToken;
333-
builder.macShortMd5 = self.macShortMd5;
334336
builder.macSha1 = self.macSha1;
335337
builder.trackingEnabled = self.trackingEnabled;
336338
builder.idForAdvertisers = self.idForAdvertisers;
337339
builder.fbAttributionId = self.fbAttributionId;
338340
builder.environment = self.environment;
341+
342+
if (self.trackMacMd5) {
343+
builder.macShortMd5 = self.macShortMd5;
344+
}
339345
}
340346

341347
# pragma mark - timer

AdjustIo/AIUtil.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <sys/xattr.h>
1414

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

1818

1919
#pragma mark -

AdjustIo/AdjustIo.h

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,23 @@ static NSString * const AIEnvironmentProduction = @"production";
6767
+ (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken;
6868
+ (void)trackRevenue:(double)amountInCents forEvent:(NSString *)eventToken withParameters:(NSDictionary *)parameters;
6969

70+
/**
71+
* Change the verbosity of AdjustIo's logs.
72+
*
73+
* You can increase or reduce the amount of logs from AdjustIo by passing
74+
* one of the following parameters. Use Log.ASSERT to disable all logging.
75+
*
76+
* @param logLevel The desired minimum log level (default: info)
77+
* Must be one of the following:
78+
* - AILogLevelVerbose (enable all logging)
79+
* - AILogLevelDebug (enable more logging)
80+
* - AILogLevelInfo (the default)
81+
* - AILogLevelWarn (disable info logging)
82+
* - AILogLevelError (disable warnings as well)
83+
* - AILogLevelAssert (disable errors as well)
84+
*/
85+
+ (void)setLogLevel:(AILogLevel)logLevel;
86+
7087
/**
7188
* Set the tracking environment to sandbox or production.
7289
*
@@ -88,21 +105,11 @@ static NSString * const AIEnvironmentProduction = @"production";
88105
+ (void)setEventBufferingEnabled:(BOOL)enabled;
89106

90107
/**
91-
* Change the verbosity of AdjustIo's logs.
92-
*
93-
* You can increase or reduce the amount of logs from AdjustIo by passing
94-
* one of the following parameters. Use Log.ASSERT to disable all logging.
108+
* Enable or disable tracking of the MD5 hash of the MAC address
95109
*
96-
* @param logLevel The desired minimum log level (default: info)
97-
* Must be one of the following:
98-
* - AILogLevelVerbose (enable all logging)
99-
* - AILogLevelDebug (enable more logging)
100-
* - AILogLevelInfo (the default)
101-
* - AILogLevelWarn (disable info logging)
102-
* - AILogLevelError (disable warnings as well)
103-
* - AILogLevelAssert (disable errors as well)
110+
* Disable macMd5 tracking if your privacy constraints require it.
104111
*/
105-
+ (void)setLogLevel:(AILogLevel)logLevel;
112+
+ (void)setMacMd5TrackingEnabled:(BOOL)enabled;
106113

107114
// Special method used by SDK wrappers such as Adobe Air SDK.
108115
+ (void)setSdkPrefix:(NSString *)sdkPrefix __attribute__((deprecated));

AdjustIo/AdjustIo.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ + (void)trackRevenue:(double)amountInCents
5151
[activityHandler trackRevenue:amountInCents forEvent:eventToken withParameters:parameters];
5252
}
5353

54+
+ (void)setLogLevel:(AILogLevel)logLevel {
55+
[AILogger setLogLevel:logLevel];
56+
}
57+
5458
+ (void)setEnvironment:(NSString *)environment {
5559
if (activityHandler == nil) {
5660
[AILogger error:@"Please call `setEnvironment` after `appDidLaunch`!"];
@@ -77,8 +81,14 @@ + (void)setEventBufferingEnabled:(BOOL)enabled {
7781
if (enabled) [AILogger info:@"Event buffering is enabled"];
7882
}
7983

80-
+ (void)setLogLevel:(AILogLevel)logLevel {
81-
[AILogger setLogLevel:logLevel];
84+
+ (void)setMacMd5TrackingEnabled:(BOOL)enabled {
85+
if (activityHandler == nil) {
86+
[AILogger error:@"Please call `setMacMd5TrackingEnabled` after `appDidLaunch`!"];
87+
return;
88+
}
89+
90+
activityHandler.trackMacMd5 = enabled;
91+
[AILogger info:@"Tracking of macMd5 is %@", enabled ? @"enabled" : @"disabled"];
8292
}
8393

8494
@end

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you're using [CocoaPods][cocoapods], you can add the following line to your
1313
`Podfile` and continue with [step 3](#step3):
1414

1515
```ruby
16-
pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.3'
16+
pod 'AdjustIO', :git => 'git://github.com/adeven/adjust_ios_sdk.git', :tag => 'v2.1.4'
1717
```
1818

1919
### 1. Get the SDK

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.3
1+
2.1.4

doc/migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.3
1+
## Migrate your AdjustIo SDK for iOS from v1.x to v2.1.4
22

33
1. Delete the old `AdjustIo` source folder from your Xcode project. Download
4-
version v2.1.3 and drag the new folder into your Xcode project.
4+
version v2.1.4 and drag the new folder into your Xcode project.
55

66
![][drag]
77

@@ -55,7 +55,7 @@
5555
2. The `appDidLaunch` method now expects your App Token instead of your App ID.
5656
You can find your App Token in your [dashboard].
5757

58-
2. The AdjustIo SDK for iOS 2.1.3 uses [ARC][arc]. If you haven't done already,
58+
2. The AdjustIo SDK for iOS 2.1.4 uses [ARC][arc]. If you haven't done already,
5959
we recommend [transitioning your project to use ARC][transition] as well. If
6060
you don't want to use ARC, you have to enable ARC for all files of the
6161
AdjustIo SDK. Please consult the [README] for details.

0 commit comments

Comments
 (0)