Skip to content

Commit

Permalink
Prepare for release 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
chshapiro committed Jul 13, 2017
1 parent aa4ec00 commit 4a85fa2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.7
* Supports analytics-ios 3.+ and Appboy 2.30.0+
* Fixes an issue where install attribution data was being sent up as an event.

## 1.0.6
* Updates the wrapper SDK to work with Xcode 9 beta 2.

Expand Down
7 changes: 7 additions & 0 deletions Example/Segment-Appboy/SEGViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ - (IBAction)trackButtonPress:(id)sender {
properties:@{ propertyKey: propertyValue}];
[[SEGAnalytics sharedAnalytics] track:@"Candy"
properties:@{ @"currency": @"CNY", @"revenue" : @"60", @"property" : @"milky white rabbit"}];
[[SEGAnalytics sharedAnalytics] track:@"Install Attributed"
properties: @{@"provider" : @"Tune/Kochava/Branch",
@"campaign" : @{@"source" : @"Network/FB/AdWords/MoPub/Source",
@"name" : @"Campaign Name",
@"content" : @"Organic Content Title",
@"ad_creative" : @"Red Hello World Ad",
@"ad_group" : @"Red Ones"}}];
}

- (IBAction)feedbackButtonPress:(id)sender {
Expand Down
15 changes: 15 additions & 0 deletions Pod/Classes/SEGAppboyIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
#if defined(__has_include) && __has_include(<Appboy_iOS_SDK/AppboyKit.h>)
#import <Appboy_iOS_SDK/AppboyKit.h>
#import <Appboy_iOS_SDK/ABKUser.h>
#import <Appboy_iOS_SDK/ABKAttributionData.h>
#else
#import "Appboy-iOS-SDK/AppboyKit.h"
#import "Appboy-iOS-SDK/ABKUser.h"
#import "Appboy-iOS-SDK/ABKAttributionData.h"
#endif
#import <Analytics/SEGAnalyticsUtils.h>
#import "SEGAppboyIntegrationFactory.h"
Expand Down Expand Up @@ -165,6 +167,19 @@ - (void)identify:(SEGIdentifyPayload *)payload

- (void)track:(SEGTrackPayload *)payload
{
if ([payload.event isEqualToString:@"Install Attributed"]) {
if ([payload.properties[@"campaign"] isKindOfClass:[NSDictionary class]]) {
NSDictionary *attributionDataDictionary = (NSDictionary *)payload.properties[@"campaign"];
ABKAttributionData *attributionData = [[ABKAttributionData alloc]
initWithNetwork:attributionDataDictionary[@"source"]
campaign:attributionDataDictionary[@"name"]
adGroup:attributionDataDictionary[@"ad_group"]
creative:attributionDataDictionary[@"ad_creative"]];
[[Appboy sharedInstance].user setAttributionData:attributionData];
return;
}
}

NSDecimalNumber *revenue = [SEGAppboyIntegration extractRevenue:payload.properties withKey:@"revenue"];
if (revenue) {
NSString *currency = @"USD"; // Make USD as the default currency.
Expand Down
2 changes: 1 addition & 1 deletion Segment-Appboy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Segment-Appboy"
s.version = "1.0.6"
s.version = "1.0.7"
s.summary = "Appboy Integration for Segment's analytics-ios library."

s.description = <<-DESC
Expand Down

0 comments on commit 4a85fa2

Please sign in to comment.