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
4 changes: 2 additions & 2 deletions Adjust.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Adjust"
s.version = "3.3.3"
s.version = "3.3.4"
s.summary = "This is the iOS SDK of Adjust. 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@adjust.com" }
s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v3.3.3" }
s.source = { :git => "https://github.com/adeven/adjust_ios_sdk.git", :tag => "v3.3.4" }
s.platform = :ios, '4.3'
s.framework = 'SystemConfiguration'
s.weak_framework = 'AdSupport', 'iAd'
Expand Down
13 changes: 13 additions & 0 deletions Adjust/AIResponseData.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
// tracker name of current device
@property (nonatomic, copy) NSString *trackerName;

// tracker network
@property (nonatomic, copy) NSString *network;

// tracker campaign
@property (nonatomic, copy) NSString *campaign;

// tracker adgroup
@property (nonatomic, copy) NSString *adgroup;

// tracker creative
@property (nonatomic, copy) NSString *creative;


// returns human readable version of activityKind
// (session, event, revenue), see above
- (NSString *)activityKindString;
Expand Down
30 changes: 28 additions & 2 deletions Adjust/AIResponseData.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ - (id)initWithJsonString:(NSString *)jsonString {
self.error = [jsonDict objectForKey:@"error"];
self.trackerToken = [jsonDict objectForKey:@"tracker_token"];
self.trackerName = [jsonDict objectForKey:@"tracker_name"];
self.network = [jsonDict objectForKey:@"network"];
self.campaign = [jsonDict objectForKey:@"campaign"];
self.adgroup = [jsonDict objectForKey:@"adgroup"];
self.creative = [jsonDict objectForKey:@"creative"];

return self;
}
Expand All @@ -53,13 +57,19 @@ - (NSString *)activityKindString {
}

- (NSString *)description {
return [NSString stringWithFormat:@"[kind:%@ success:%d willRetry:%d error:%@ trackerToken:%@ trackerName:%@]",
return [NSString stringWithFormat:@"[kind:%@ success:%d willRetry:%d "
"error:%@ trackerToken:%@ trackerName:%@ "
"network:%@ campaign:%@ adgroup:%@ creative:%@]",
self.activityKindString,
self.success,
self.willRetry,
self.error.aiQuote,
self.trackerToken,
self.trackerName.aiQuote];
self.trackerName.aiQuote,
self.network.aiQuote,
self.campaign.aiQuote,
self.adgroup.aiQuote,
self.creative.aiQuote];
}

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

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"];
}

return responseDataDic;
}

Expand Down
2 changes: 1 addition & 1 deletion Adjust/AIUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <sys/xattr.h>

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

static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss'Z'Z";
static NSDateFormatter * dateFormat;
Expand Down
2 changes: 1 addition & 1 deletion AdjustTests/AIActivityHandlerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)testFirstRun
AIActivityPackage *activityPackage = (AIActivityPackage *) self.packageHandlerMock.packageQueue[0];

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

// check the server url
XCTAssertEqual(@"https://app.adjust.io", AIUtil.baseUrl);
Expand Down
11 changes: 7 additions & 4 deletions AdjustTests/AIRequestHandlerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ - (void)testSendPackage

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

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

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

// check that the package was successfully sent
XCTAssert([self.loggerMock containsMessage:AILogLevelError beginsWith:@"Failed to track session. (connection error) Will retry later."],
Expand All @@ -136,14 +138,15 @@ - (void)testResponseError {
// check the URL Connection was called
XCTAssert([self.loggerMock containsMessage:AILogLevelTest beginsWith:@"NSURLConnection sendSynchronousRequest"],
@"%@", self.loggerMock);

// check that the package handler was pinged after sending
XCTAssert([self.loggerMock containsMessage:AILogLevelTest beginsWith:@"AIPackageHandler finishedTrackingActivity"],
@"%@", self.loggerMock);

// check the response data,
NSString *sresponseData= [NSString stringWithFormat:@"%@", self.packageHandlerMock.responseData];
XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:0 error:'response error' trackerToken:token trackerName:name]"], @"%@", sresponseData);

XCTAssert([sresponseData isEqualToString:@"[kind:unknown success:0 willRetry:0 error:'response error' "
"trackerToken:(null) trackerName:(null) network:(null) campaign:(null) adgroup:(null) creative:(null)]"], @"%@", sresponseData);

// check that the package was successfully sent
XCTAssert([self.loggerMock containsMessage:AILogLevelError beginsWith:@"Failed to track session. (response error)"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NS
NSString * sResponseBase64;
if (triggerResponseError) {
statusCode = 0;
// encoded from "{"error":"response error","tracker_token":"token","tracker_name":"name"}"
sResponseBase64 = @"eyJlcnJvciI6InJlc3BvbnNlIGVycm9yIiwidHJhY2tlcl90b2tlbiI6InRva2VuIiwidHJhY2tlcl9uYW1lIjoibmFtZSJ9";
// encoded from "{"error":"response error"}"
sResponseBase64 = @"eyJlcnJvciI6InJlc3BvbnNlIGVycm9yIn0=";
} else {
statusCode = 200;
// encoded from "{"tracker_token":"token","tracker_name":"name"}"
sResponseBase64 = @"eyJ0cmFja2VyX3Rva2VuIjoidG9rZW4iLCJ0cmFja2VyX25hbWUiOiJuYW1lIn0=";
// encoded from "{"tracker_token":"token","tracker_name":"name", "network":"network", "campaign":"campaign", "adgroup":"adgroup", "creative":"creative"}"
sResponseBase64 = @"eyJ0cmFja2VyX3Rva2VuIjoidG9rZW4iLCJ0cmFja2VyX25hbWUiOiJuYW1lIiwgIm5ldHdvcmsiOiJuZXR3b3JrIiwgImNhbXBhaWduIjoiY2FtcGFpZ24iLCAiYWRncm91cCI6ImFkZ3JvdXAiLCAiY3JlYXRpdmUiOiJjcmVhdGl2ZSJ9";
}
// build response
(*response) = [[NSHTTPURLResponse alloc] initWithURL:[[NSURL alloc] init] statusCode:statusCode HTTPVersion:@"" headerFields:nil];
Expand Down
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 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v3.3.3'
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v3.3.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 @@
3.3.3
3.3.4
8 changes: 4 additions & 4 deletions doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your adjust SDK for iOS to v3.3.3 from v3.0.0
## Migrate your adjust SDK for iOS to v3.3.4 from v3.0.0

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:

Expand Down Expand Up @@ -36,14 +36,14 @@ all adjust SDK calls.

![][rename]

3. Download version v3.3.3 and drag the new folder `Adjust` into your Xcode
3. Download version v3.3.4 and drag the new folder `Adjust` into your Xcode
Project Navigator.

![][drag]

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

The adjust SDK v3.3.3 added delegate callbacks. Check out the [README] for
The adjust SDK v3.3.4 added delegate callbacks. Check out the [README] for
details.


Expand Down Expand Up @@ -99,7 +99,7 @@ meaningful at all times! Especially if you are tracking revenue.
1. The `appDidLaunch` method now expects your App Token instead of your App ID.
You can find your App Token in your [dashboard].

2. The adjust SDK for iOS 3.3.3 uses [ARC][arc]. If you haven't done already,
2. The adjust SDK for iOS 3.3.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
adjust SDK. Please consult the [README] for details.
Expand Down
24 changes: 24 additions & 0 deletions doc/mixpanel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
##Integrate adjust with Mixpanel SDK

The Mixpanel API allows to register common properties to be sent in all events as `super properties`, as it is explained in the [Mixpanel page][mixpanel_ios]. To integrate adjust with all tracked events of Mixpanel, you must set the `super properties` after receiving the response data of each event. Follow the steps of the [delegate callbacks][response_callbacks] chapter in our iOS SDK guide to implement it.
The delegate function can be set as the following, to use the Mixpanel API:

```objc
- (void)adjustFinishedTrackingWithResponse:(AIResponseData *)responseData {
Mixpanel *mixpanel = [Mixpanel sharedInstance];

// The adjust properties properties will be sent
// with all future track calls.
if (responseData.network != nil)
[mixpanel registerSuperProperties:@{@"[Adjust]Network": responseData.network}];
if (responseData.campaign != nil)
[mixpanel registerSuperProperties:@{@"[Adjust]Campaign": responseData.campaign}];
if (responseData.adgroup != nil)
[mixpanel registerSuperProperties:@{@"[Adjust]Adgroup": responseData.adgroup}];
if (responseData.creative != nil)
[mixpanel registerSuperProperties:@{@"[Adjust]Creative": responseData.creative}];
}
```

[mixpanel_ios]: https://mixpanel.com/help/reference/ios#super-properties
[response_callbacks]: https://github.com/adjust/ios_sdk#9-receive-delegate-callbacks