Skip to content

Commit e24f73a

Browse files
committed
Merge pull request #51 from adjust/mixpanel
Mixpanel API integration
2 parents e875b89 + 1ac0876 commit e24f73a

File tree

11 files changed

+86
-20
lines changed

11 files changed

+86
-20
lines changed

Adjust.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 = "Adjust"
3-
s.version = "3.3.3"
3+
s.version = "3.3.4"
44
s.summary = "This is the iOS SDK of Adjust. 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 => "v3.3.3" }
8+
s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v3.3.4" }
99
s.platform = :ios, '4.3'
1010
s.framework = 'SystemConfiguration'
1111
s.weak_framework = 'AdSupport', 'iAd'

Adjust/AIResponseData.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@
4545
// tracker name of current device
4646
@property (nonatomic, copy) NSString *trackerName;
4747

48+
// tracker network
49+
@property (nonatomic, copy) NSString *network;
50+
51+
// tracker campaign
52+
@property (nonatomic, copy) NSString *campaign;
53+
54+
// tracker adgroup
55+
@property (nonatomic, copy) NSString *adgroup;
56+
57+
// tracker creative
58+
@property (nonatomic, copy) NSString *creative;
59+
60+
4861
// returns human readable version of activityKind
4962
// (session, event, revenue), see above
5063
- (NSString *)activityKindString;

Adjust/AIResponseData.m

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ - (id)initWithJsonString:(NSString *)jsonString {
3434
self.error = [jsonDict objectForKey:@"error"];
3535
self.trackerToken = [jsonDict objectForKey:@"tracker_token"];
3636
self.trackerName = [jsonDict objectForKey:@"tracker_name"];
37+
self.network = [jsonDict objectForKey:@"network"];
38+
self.campaign = [jsonDict objectForKey:@"campaign"];
39+
self.adgroup = [jsonDict objectForKey:@"adgroup"];
40+
self.creative = [jsonDict objectForKey:@"creative"];
3741

3842
return self;
3943
}
@@ -53,13 +57,19 @@ - (NSString *)activityKindString {
5357
}
5458

5559
- (NSString *)description {
56-
return [NSString stringWithFormat:@"[kind:%@ success:%d willRetry:%d error:%@ trackerToken:%@ trackerName:%@]",
60+
return [NSString stringWithFormat:@"[kind:%@ success:%d willRetry:%d "
61+
"error:%@ trackerToken:%@ trackerName:%@ "
62+
"network:%@ campaign:%@ adgroup:%@ creative:%@]",
5763
self.activityKindString,
5864
self.success,
5965
self.willRetry,
6066
self.error.aiQuote,
6167
self.trackerToken,
62-
self.trackerName.aiQuote];
68+
self.trackerName.aiQuote,
69+
self.network.aiQuote,
70+
self.campaign.aiQuote,
71+
self.adgroup.aiQuote,
72+
self.creative.aiQuote];
6373
}
6474

6575
- (NSDictionary *)dictionary {
@@ -81,6 +91,22 @@ - (NSDictionary *)dictionary {
8191
[responseDataDic setObject:self.trackerName forKey:@"trackerName"];
8292
}
8393

94+
if (self.network != nil) {
95+
[responseDataDic setObject:self.network forKey:@"network"];
96+
}
97+
98+
if (self.campaign != nil) {
99+
[responseDataDic setObject:self.campaign forKey:@"campaign"];
100+
}
101+
102+
if (self.adgroup != nil) {
103+
[responseDataDic setObject:self.adgroup forKey:@"adgroup"];
104+
}
105+
106+
if (self.creative != nil) {
107+
[responseDataDic setObject:self.creative forKey:@"creative"];
108+
}
109+
84110
return responseDataDic;
85111
}
86112

Adjust/AIUtil.m

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

1616
static NSString * const kBaseUrl = @"https://app.adjust.io";
17-
static NSString * const kClientSdk = @"ios3.3.3";
17+
static NSString * const kClientSdk = @"ios3.3.4";
1818

1919
static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss'Z'Z";
2020
static NSDateFormatter * dateFormat;

AdjustTests/AIActivityHandlerTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ - (void)testFirstRun
9090
AIActivityPackage *activityPackage = (AIActivityPackage *) self.packageHandlerMock.packageQueue[0];
9191

9292
// check the Sdk version is being tested
93-
XCTAssertEqual(@"ios3.3.3", activityPackage.clientSdk, @"%@", activityPackage.extendedString);
93+
XCTAssertEqual(@"ios3.3.4", activityPackage.clientSdk, @"%@", activityPackage.extendedString);
9494

9595
// check the server url
9696
XCTAssertEqual(@"https://app.adjust.io", AIUtil.baseUrl);

AdjustTests/AIRequestHandlerTests.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ - (void)testSendPackage
7676

7777
// check the response data, the kind is unknown because is set by the package handler
7878
NSString *sresponseData= [NSString stringWithFormat:@"%@", self.packageHandlerMock.responseData];
79-
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:1 willRetry:0 error:(null) trackerToken:token trackerName:name]"],
79+
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:1 willRetry:0 error:(null) "
80+
"trackerToken:token trackerName:name network:network campaign:campaign adgroup:adgroup creative:creative]"],
8081
@"%@", sresponseData);
8182

8283
// check that the package was successfully sent
@@ -110,7 +111,8 @@ - (void)testConnectionError {
110111

111112
// check the response data,
112113
NSString *sresponseData= [NSString stringWithFormat:@"%@", self.packageHandlerMock.responseData];
113-
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:1 error:'connection error' trackerToken:(null) trackerName:(null)]"], @"%@", sresponseData);
114+
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:1 error:'connection error' "
115+
"trackerToken:(null) trackerName:(null) network:(null) campaign:(null) adgroup:(null) creative:(null)]"], @"%@", sresponseData);
114116

115117
// check that the package was successfully sent
116118
XCTAssert([self.loggerMock containsMessage:AILogLevelError beginsWith:@"Failed to track session. (connection error) Will retry later."],
@@ -136,14 +138,15 @@ - (void)testResponseError {
136138
// check the URL Connection was called
137139
XCTAssert([self.loggerMock containsMessage:AILogLevelTest beginsWith:@"NSURLConnection sendSynchronousRequest"],
138140
@"%@", self.loggerMock);
139-
140141
// check that the package handler was pinged after sending
141142
XCTAssert([self.loggerMock containsMessage:AILogLevelTest beginsWith:@"AIPackageHandler finishedTrackingActivity"],
142143
@"%@", self.loggerMock);
143144

144145
// check the response data,
145146
NSString *sresponseData= [NSString stringWithFormat:@"%@", self.packageHandlerMock.responseData];
146-
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:0 error:'response error' trackerToken:token trackerName:name]"], @"%@", sresponseData);
147+
148+
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:0 error:'response error' "
149+
"trackerToken:(null) trackerName:(null) network:(null) campaign:(null) adgroup:(null) creative:(null)]"], @"%@", sresponseData);
147150

148151
// check that the package was successfully sent
149152
XCTAssert([self.loggerMock containsMessage:AILogLevelError beginsWith:@"Failed to track session. (response error)"],

AdjustTests/NSURLConnection+NSURLConnectionSynchronousLoadingMocking.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NS
2929
NSString * sResponseBase64;
3030
if (triggerResponseError) {
3131
statusCode = 0;
32-
// encoded from "{"error":"response error","tracker_token":"token","tracker_name":"name"}"
33-
sResponseBase64 = @"eyJlcnJvciI6InJlc3BvbnNlIGVycm9yIiwidHJhY2tlcl90b2tlbiI6InRva2VuIiwidHJhY2tlcl9uYW1lIjoibmFtZSJ9";
32+
// encoded from "{"error":"response error"}"
33+
sResponseBase64 = @"eyJlcnJvciI6InJlc3BvbnNlIGVycm9yIn0=";
3434
} else {
3535
statusCode = 200;
36-
// encoded from "{"tracker_token":"token","tracker_name":"name"}"
37-
sResponseBase64 = @"eyJ0cmFja2VyX3Rva2VuIjoidG9rZW4iLCJ0cmFja2VyX25hbWUiOiJuYW1lIn0=";
36+
// encoded from "{"tracker_token":"token","tracker_name":"name", "network":"network", "campaign":"campaign", "adgroup":"adgroup", "creative":"creative"}"
37+
sResponseBase64 = @"eyJ0cmFja2VyX3Rva2VuIjoidG9rZW4iLCJ0cmFja2VyX25hbWUiOiJuYW1lIiwgIm5ldHdvcmsiOiJuZXR3b3JrIiwgImNhbXBhaWduIjoiY2FtcGFpZ24iLCAiYWRncm91cCI6ImFkZ3JvdXAiLCAiY3JlYXRpdmUiOiJjcmVhdGl2ZSJ9";
3838
}
3939
// build response
4040
(*response) = [[NSHTTPURLResponse alloc] initWithURL:[[NSURL alloc] init] statusCode:statusCode HTTPVersion:@"" headerFields:nil];

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 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v3.3.3'
16+
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v3.3.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-
3.3.3
1+
3.3.4

doc/migrate.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Migrate your adjust SDK for iOS to v3.3.3 from v3.0.0
1+
## Migrate your adjust SDK for iOS to v3.3.4 from v3.0.0
22

33
We added an optional parameter `transactionId` to our `trackRevenue` methods. If you are tracking In-App Purchases you might want to pass in the transaction identifier provided by Apple to avoid duplicate revenue tracking. It should look roughly like this:
44

@@ -36,14 +36,14 @@ all adjust SDK calls.
3636

3737
![][rename]
3838

39-
3. Download version v3.3.3 and drag the new folder `Adjust` into your Xcode
39+
3. Download version v3.3.4 and drag the new folder `Adjust` into your Xcode
4040
Project Navigator.
4141

4242
![][drag]
4343

4444
4. Build your project to confirm that everything is properly connected again.
4545

46-
The adjust SDK v3.3.3 added delegate callbacks. Check out the [README] for
46+
The adjust SDK v3.3.4 added delegate callbacks. Check out the [README] for
4747
details.
4848

4949

@@ -99,7 +99,7 @@ meaningful at all times! Especially if you are tracking revenue.
9999
1. The `appDidLaunch` method now expects your App Token instead of your App ID.
100100
You can find your App Token in your [dashboard].
101101
102-
2. The adjust SDK for iOS 3.3.3 uses [ARC][arc]. If you haven't done already,
102+
2. The adjust SDK for iOS 3.3.4 uses [ARC][arc]. If you haven't done already,
103103
we recommend [transitioning your project to use ARC][transition] as well. If
104104
you don't want to use ARC, you have to enable ARC for all files of the
105105
adjust SDK. Please consult the [README] for details.

0 commit comments

Comments
 (0)