Skip to content

Commit ab2d5d9

Browse files
committed
Merge pull request #87 from adjust/criteo_update
Criteo update
2 parents a09323c + ec27267 commit ab2d5d9

File tree

10 files changed

+247
-88
lines changed

10 files changed

+247
-88
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 = "4.0.7"
3+
s.version = "4.0.8"
44
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
55
s.homepage = "http://adjust.com"
66
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
77
s.author = { "Christian Wellenbrock" => "[email protected]" }
8-
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.7" }
8+
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.8" }
99
s.platform = :ios, '4.3'
1010
s.framework = 'SystemConfiguration'
1111
s.weak_framework = 'AdSupport', 'iAd'

Adjust/ADJActivityPackage.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ - (NSString *)extendedString {
2424
[builder appendFormat:@"ClientSdk: %@\n", self.clientSdk];
2525

2626
if (self.parameters != nil) {
27+
NSArray * sortedKeys = [[self.parameters allKeys] sortedArrayUsingSelector:@selector(localizedStandardCompare:)];
28+
NSUInteger keyCount = [sortedKeys count];
2729
[builder appendFormat:@"Parameters:"];
28-
for (NSString *key in self.parameters) {
30+
for (int i = 0; i < keyCount; i++) {
31+
NSString *key = (NSString*)[sortedKeys objectAtIndex:i];
2932
NSString *value = [self.parameters objectForKey:key];
3033
[builder appendFormat:@"\n\t\t%-22s %@", [key UTF8String], value];
3134
}

Adjust/ADJUtil.m

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

1818
static NSString * const kBaseUrl = @"https://app.adjust.com";
19-
static NSString * const kClientSdk = @"ios4.0.7";
19+
static NSString * const kClientSdk = @"ios4.0.8";
2020

2121
static NSString * const kDateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'Z";
2222
static NSDateFormatter *dateFormat;

AdjustTests/ADJActivityHandlerTests.m

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

123123
// check the Sdk version is being tested
124-
XCTAssertEqual(@"ios4.0.7", activityPackage.clientSdk, @"%@", activityPackage.extendedString);
124+
XCTAssertEqual(@"ios4.0.8", activityPackage.clientSdk, @"%@", activityPackage.extendedString);
125125

126126
// check the server url
127127
XCTAssertEqual(@"https://app.adjust.com", ADJUtil.baseUrl);

README.md

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

1919
```ruby
20-
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.0.7'
20+
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.0.8'
2121
```
2222

2323
### 1. Get the SDK

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.7
1+
4.0.8

doc/criteo_plugin.md

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ to `Copy items if needed` and select the radio button to `Create groups`.
1111

1212
Now you can integrate each of the different Criteo events, like in the following examples:
1313

14-
### View Homepage
15-
16-
```objc
17-
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewHomepageEventToken}"];
18-
19-
[Adjust trackEvent:event];
20-
```
21-
2214
### View Search
2315

2416
```objc
@@ -38,12 +30,9 @@ ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewSearchEventToken}"];
3830
3931
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"];
4032
41-
ADJCriteoProduct *product1 = [ADJCriteoProduct productWithId:@"productId1" price:100.0 quantity:1];
42-
ADJCriteoProduct *product2 = [ADJCriteoProduct productWithId:@"productId2" price:77.7 quantity:3];
43-
ADJCriteoProduct *product3 = [ADJCriteoProduct productWithId:@"productId3" price:50 quantity:2];
44-
NSArray *products = @[product1, product2, product3];
33+
NSArray *productIds = @[@"productId1", @"productId2", @"product3"];
4534
46-
[ADJCriteo injectViewListingIntoEvent:event products:products customerId:@"customerId1"];
35+
[ADJCriteo injectViewListingIntoEvent:event productIds:productIds customerId:@"customerId1"];
4736
4837
[Adjust trackEvent:event];
4938
```
@@ -93,3 +82,76 @@ NSArray *products = @[product1, product2, product3];
9382

9483
[Adjust trackEvent:event];
9584
```
85+
86+
### User Level
87+
88+
```objc
89+
#import "ADJCriteo.h"
90+
91+
ADJEvent *event = [ADJEvent eventWithEventToken:@"{userLevelEventToken}"];
92+
93+
[ADJCriteo injectUserLevelIntoEvent:event uiLevel:1 customerId:@"customerId1"];
94+
95+
[Adjust trackEvent:event];
96+
```
97+
98+
### User Status
99+
100+
```objc
101+
#import "ADJCriteo.h"
102+
103+
ADJEvent *event = [ADJEvent eventWithEventToken:@"{userStatusEventToken}"];
104+
105+
[ADJCriteo injectUserStatusIntoEvent:event uiStatus:@"uiStatusValue" customerId:@"customerId1"];
106+
107+
[Adjust trackEvent:event];
108+
```
109+
110+
### Achievement Unlocked
111+
112+
```objc
113+
#import "ADJCriteo.h"
114+
115+
ADJEvent *event = [ADJEvent eventWithEventToken:@"{achievementUnlockedEventToken}"];
116+
117+
[ADJCriteo injectAchievementUnlockedIntoEvent:event uiAchievement:@"uiAchievementValue" customerId:@"customerId"];
118+
119+
[Adjust trackEvent:event];
120+
```
121+
122+
### Custom Event
123+
124+
```objc
125+
#import "ADJCriteo.h"
126+
127+
ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEventEventToken}"];
128+
129+
[ADJCriteo injectCustomEventIntoEvent:event uiData:@"uiDataValue" customerId:@"customerId"];
130+
131+
[Adjust trackEvent:event];
132+
```
133+
134+
### Custom Event 2
135+
136+
```objc
137+
#import "ADJCriteo.h"
138+
139+
ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEvent2EventToken}"];
140+
141+
[ADJCriteo injectCustomEvent2IntoEvent:event uiData2:@"uiDataValue2" uiData3:3 customerId:@"customerId"];
142+
143+
[Adjust trackEvent:event];
144+
```
145+
146+
### Hashed Email
147+
148+
It's possible to attach an hashed email in every Criteo event with the `injectHashedEmailIntoCriteoEvents` method.
149+
The hashed email will be sent with every Criteo event for the duration of the application lifecycle,
150+
so it must be set again when the app is re-lauched.
151+
The hashed email can be removed by setting the `injectHashedEmailIntoCriteoEvents` method with `nil`.
152+
153+
```objc
154+
#import "ADJCriteo.h"
155+
156+
AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e");
157+
```

doc/migrate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Migrate your adjust SDK for iOS to v4.0.7 from v3.4.0
1+
## Migrate your adjust SDK for iOS to v4.0.8 from v3.4.0
22

33
### Initial setup
44

plugin/ADJCriteo.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
checkOutDate:(NSString *)dout;
3333

3434
+ (void)injectViewListingIntoEvent:(ADJEvent *)event
35-
products:(NSArray *)products
35+
productIds:(NSArray *)productIds
3636
customerId:(NSString *)customerId;
3737

3838
+ (void)injectViewProductIntoEvent:(ADJEvent *)event
@@ -47,4 +47,26 @@
4747
products:(NSArray *)products
4848
customerId:(NSString *)customerId;
4949

50+
+ (void)injectUserLevelIntoEvent:(ADJEvent *)event
51+
uiLevel:(NSUInteger)uiLevel
52+
customerId:(NSString *)customerId;
53+
54+
+ (void)injectUserStatusIntoEvent:(ADJEvent *)event
55+
uiStatus:(NSString *)uiStatus
56+
customerId:(NSString *)customerId;
57+
58+
+ (void)injectAchievementUnlockedIntoEvent:(ADJEvent *)event
59+
uiAchievement:(NSString *)uiAchievement
60+
customerId:(NSString *)customerId;
61+
62+
+ (void)injectCustomEventIntoEvent:(ADJEvent *)event
63+
uiData:(NSString *)uiData
64+
customerId:(NSString *)customerId;
65+
66+
+ (void)injectCustomEvent2IntoEvent:(ADJEvent *)event
67+
uiData2:(NSString *)uiData2
68+
uiData3:(NSUInteger)uiData3
69+
customerId:(NSString *)customerId;
70+
71+
+ (void)injectHashedEmailIntoCriteoEvents:(NSString *)hashEmail;
5072
@end

0 commit comments

Comments
 (0)