Skip to content

Commit

Permalink
Merge pull request #87 from adjust/criteo_update
Browse files Browse the repository at this point in the history
Criteo update
  • Loading branch information
nonelse committed Mar 23, 2015
2 parents a09323c + ec27267 commit ab2d5d9
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 88 deletions.
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 = "4.0.7"
s.version = "4.0.8"
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com."
s.homepage = "http://adjust.com"
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' }
s.author = { "Christian Wellenbrock" => "welle@adjust.com" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.7" }
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.8" }
s.platform = :ios, '4.3'
s.framework = 'SystemConfiguration'
s.weak_framework = 'AdSupport', 'iAd'
Expand Down
5 changes: 4 additions & 1 deletion Adjust/ADJActivityPackage.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ - (NSString *)extendedString {
[builder appendFormat:@"ClientSdk: %@\n", self.clientSdk];

if (self.parameters != nil) {
NSArray * sortedKeys = [[self.parameters allKeys] sortedArrayUsingSelector:@selector(localizedStandardCompare:)];
NSUInteger keyCount = [sortedKeys count];
[builder appendFormat:@"Parameters:"];
for (NSString *key in self.parameters) {
for (int i = 0; i < keyCount; i++) {
NSString *key = (NSString*)[sortedKeys objectAtIndex:i];
NSString *value = [self.parameters objectForKey:key];
[builder appendFormat:@"\n\t\t%-22s %@", [key UTF8String], value];
}
Expand Down
2 changes: 1 addition & 1 deletion Adjust/ADJUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <sys/xattr.h>

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

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

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

// check the server url
XCTAssertEqual(@"https://app.adjust.com", ADJUtil.baseUrl);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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 => 'v4.0.7'
pod 'Adjust', :git => 'git://github.com/adjust/ios_sdk.git', :tag => 'v4.0.8'
```

### 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 @@
4.0.7
4.0.8
88 changes: 75 additions & 13 deletions doc/criteo_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ to `Copy items if needed` and select the radio button to `Create groups`.

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

### View Homepage

```objc
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewHomepageEventToken}"];

[Adjust trackEvent:event];
```
### View Search

```objc
Expand All @@ -38,12 +30,9 @@ ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewSearchEventToken}"];
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"];
ADJCriteoProduct *product1 = [ADJCriteoProduct productWithId:@"productId1" price:100.0 quantity:1];
ADJCriteoProduct *product2 = [ADJCriteoProduct productWithId:@"productId2" price:77.7 quantity:3];
ADJCriteoProduct *product3 = [ADJCriteoProduct productWithId:@"productId3" price:50 quantity:2];
NSArray *products = @[product1, product2, product3];
NSArray *productIds = @[@"productId1", @"productId2", @"product3"];
[ADJCriteo injectViewListingIntoEvent:event products:products customerId:@"customerId1"];
[ADJCriteo injectViewListingIntoEvent:event productIds:productIds customerId:@"customerId1"];
[Adjust trackEvent:event];
```
Expand Down Expand Up @@ -93,3 +82,76 @@ NSArray *products = @[product1, product2, product3];

[Adjust trackEvent:event];
```
### User Level
```objc
#import "ADJCriteo.h"
ADJEvent *event = [ADJEvent eventWithEventToken:@"{userLevelEventToken}"];
[ADJCriteo injectUserLevelIntoEvent:event uiLevel:1 customerId:@"customerId1"];
[Adjust trackEvent:event];
```

### User Status

```objc
#import "ADJCriteo.h"

ADJEvent *event = [ADJEvent eventWithEventToken:@"{userStatusEventToken}"];

[ADJCriteo injectUserStatusIntoEvent:event uiStatus:@"uiStatusValue" customerId:@"customerId1"];

[Adjust trackEvent:event];
```
### Achievement Unlocked
```objc
#import "ADJCriteo.h"
ADJEvent *event = [ADJEvent eventWithEventToken:@"{achievementUnlockedEventToken}"];
[ADJCriteo injectAchievementUnlockedIntoEvent:event uiAchievement:@"uiAchievementValue" customerId:@"customerId"];
[Adjust trackEvent:event];
```

### Custom Event

```objc
#import "ADJCriteo.h"

ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEventEventToken}"];

[ADJCriteo injectCustomEventIntoEvent:event uiData:@"uiDataValue" customerId:@"customerId"];

[Adjust trackEvent:event];
```
### Custom Event 2
```objc
#import "ADJCriteo.h"
ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEvent2EventToken}"];
[ADJCriteo injectCustomEvent2IntoEvent:event uiData2:@"uiDataValue2" uiData3:3 customerId:@"customerId"];
[Adjust trackEvent:event];
```

### Hashed Email

It's possible to attach an hashed email in every Criteo event with the `injectHashedEmailIntoCriteoEvents` method.
The hashed email will be sent with every Criteo event for the duration of the application lifecycle,
so it must be set again when the app is re-lauched.
The hashed email can be removed by setting the `injectHashedEmailIntoCriteoEvents` method with `nil`.

```objc
#import "ADJCriteo.h"

AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e");
```
2 changes: 1 addition & 1 deletion doc/migrate.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Migrate your adjust SDK for iOS to v4.0.7 from v3.4.0
## Migrate your adjust SDK for iOS to v4.0.8 from v3.4.0

### Initial setup

Expand Down
24 changes: 23 additions & 1 deletion plugin/ADJCriteo.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
checkOutDate:(NSString *)dout;

+ (void)injectViewListingIntoEvent:(ADJEvent *)event
products:(NSArray *)products
productIds:(NSArray *)productIds
customerId:(NSString *)customerId;

+ (void)injectViewProductIntoEvent:(ADJEvent *)event
Expand All @@ -47,4 +47,26 @@
products:(NSArray *)products
customerId:(NSString *)customerId;

+ (void)injectUserLevelIntoEvent:(ADJEvent *)event
uiLevel:(NSUInteger)uiLevel
customerId:(NSString *)customerId;

+ (void)injectUserStatusIntoEvent:(ADJEvent *)event
uiStatus:(NSString *)uiStatus
customerId:(NSString *)customerId;

+ (void)injectAchievementUnlockedIntoEvent:(ADJEvent *)event
uiAchievement:(NSString *)uiAchievement
customerId:(NSString *)customerId;

+ (void)injectCustomEventIntoEvent:(ADJEvent *)event
uiData:(NSString *)uiData
customerId:(NSString *)customerId;

+ (void)injectCustomEvent2IntoEvent:(ADJEvent *)event
uiData2:(NSString *)uiData2
uiData3:(NSUInteger)uiData3
customerId:(NSString *)customerId;

+ (void)injectHashedEmailIntoCriteoEvents:(NSString *)hashEmail;
@end
Loading

0 comments on commit ab2d5d9

Please sign in to comment.