Skip to content

Commit

Permalink
Prepare for release 4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chshapiro committed Sep 14, 2021
1 parent 08d89a2 commit 098dacd
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 87 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
## 4.3.0

**Note:** This version does not include Carthage support. We are revisiting our Carthage approach and will reintroduce it in an upcoming version.

#### Breaking
- Updated to [Braze tvOS SDK 4.3.x](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#430).
- A `track` call with event name `Completed Order` will now be treated as a purchase event for backwards compatibility with Segment eCommerce v1 API.

## 4.2.0

**Note:** This version does not include Carthage support. We are revisiting our Carthage approach and will reintroduce it in an upcoming version.

#### Breaking
- Updated to [Braze iOS SDK 4.3.0](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#430).
- Updated to [Braze iOS SDK 4.3.x](https://github.com/Appboy/appboy-ios-sdk/blob/master/CHANGELOG.md#430).

## 4.1.0

Expand Down
4 changes: 2 additions & 2 deletions CocoaPodsTVOSExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Analytics (4.1.3)
- Appboy-tvOS-SDK (3.27.0)
- Segment-Appboy/tvOS (3.6.1):
- Segment-Appboy/tvOS (4.2.0):
- Analytics
- Appboy-tvOS-SDK (~> 3.27.0)

Expand All @@ -21,7 +21,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Analytics: 4c01e3e19d4be86705bad6581a1c2aa5a15a9d22
Appboy-tvOS-SDK: 22993e5e47387695fe1ecec5177c16a55d427b12
Segment-Appboy: 5497f90416c09cfd603de1047c155e26a6cf4adb
Segment-Appboy: 5688916eb8fb104b638116ba251cee5d4d8bd266

PODFILE CHECKSUM: 230825da8fa8732fc38070eef05987c5967046f4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
061BC0680D461E3B23952D78 /* Pods_Segment_Appboy_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59FBC548877E32C15D404499 /* Pods_Segment_Appboy_Example.framework */; };
35C142FB277051674658B309 /* libPods-Segment-Appboy_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */; };
5D23953225D6CFA600DA929D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D23953125D6CFA600DA929D /* AppDelegate.m */; };
5D23953525D6CFA600DA929D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D23953425D6CFA600DA929D /* ViewController.m */; };
5D23953825D6CFA600DA929D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5D23953625D6CFA600DA929D /* Main.storyboard */; };
Expand All @@ -17,7 +17,6 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
59FBC548877E32C15D404499 /* Pods_Segment_Appboy_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Segment_Appboy_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5D23952D25D6CFA600DA929D /* Segment-Appboy_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Segment-Appboy_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
5D23953025D6CFA600DA929D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5D23953125D6CFA600DA929D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
Expand All @@ -30,14 +29,15 @@
5D23953F25D6CFAB00DA929D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
A4DD16D62D97ED29D6077DE5 /* Pods-Segment-Appboy_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Segment-Appboy_Example.release.xcconfig"; path = "Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example.release.xcconfig"; sourceTree = "<group>"; };
E1B569F23E59A56EE361E93D /* Pods-Segment-Appboy_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Segment-Appboy_Example.debug.xcconfig"; path = "Target Support Files/Pods-Segment-Appboy_Example/Pods-Segment-Appboy_Example.debug.xcconfig"; sourceTree = "<group>"; };
EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Segment-Appboy_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
5D23952A25D6CFA600DA929D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
061BC0680D461E3B23952D78 /* Pods_Segment_Appboy_Example.framework in Frameworks */,
35C142FB277051674658B309 /* libPods-Segment-Appboy_Example.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -81,7 +81,7 @@
A0F9256B8A1EE9C85F010D22 /* Frameworks */ = {
isa = PBXGroup;
children = (
59FBC548877E32C15D404499 /* Pods_Segment_Appboy_Example.framework */,
EAA62634F643AF5267499188 /* libPods-Segment-Appboy_Example.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion CocoaPodsTVOSExample/Segment-Appboy_Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Appboy</key>
<key>Braze</key>
<dict>
<key>LogLevel</key>
<string>0</string>
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions CocoapodsExample/Segment-Appboy/SEGViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ - (IBAction)identifyButtonPress:(id)sender {
@"integerAttribute" : @(integerAttribute),
@"floatAttribute" : @(floatAttribute),
@"shortAttribute" : @(shortAttribute),
//@"dateAttribute" : dateAttribute,
@"dateAttribute" : dateAttribute,
@"arrayAttribute" : @[@"one", @"two", @"three"],
@"gender" : @"female",
//@"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200],
@"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200],
@"firstName" : @"Appboy",
@"lastName" : @"Appboy",
@"phone" : @"1234567890",
Expand Down
2 changes: 1 addition & 1 deletion CocoapodsExample/Segment-Appboy/Segment-Appboy-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Appboy</key>
<key>Braze</key>
<dict>
<key>LogLevel</key>
<string>0</string>
Expand Down
2 changes: 1 addition & 1 deletion CocoapodsExample/Tests/SEGAppboyIntegrationFactoryTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import "SEGAppboyIntegration.h"
#import "AppboyKit.h"
#import <OCMock/OCMock.h>
#import <Analytics/SEGIntegration.h>
#import <Segment/SEGIntegration.h>
#import "SEGAnalyticsUtils.h"

SpecBegin(SEGAppboyIntegrationFactory)
Expand Down
30 changes: 27 additions & 3 deletions CocoapodsExample/Tests/SEGAppboyIntegrationTest.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "SEGAppboyIntegration.h"
#import "AppboyKit.h"
#import <OCMock/OCMock.h>
#import <Analytics/SEGIntegration.h>
#import <Segment/SEGIntegration.h>
#import "SEGAnalyticsUtils.h"

SpecBegin(InitialSpecs)
Expand Down Expand Up @@ -123,6 +123,30 @@
[appboyIntegration track:trackPayload];
OCMVerifyAllWithDelay(appboyMock, 2);
});

it(@"calls purchase for Completed Order", ^{
NSDictionary *settings = @{@"apiKey":@"foo"};
id appboyMock = OCMClassMock([Appboy class]);
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock);
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]);
OCMExpect([appboyMock logPurchase:@"Completed Order" inCurrency:@"USD" atPrice:[NSDecimalNumber decimalNumberWithString:@"55.5"]
withQuantity:1 andProperties:@{@"extraProperty" : @"extraValue"}]);

SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings];

NSDictionary *properties = @{
@"revenue" : @"55.5",
@"currency" : @"USD",
@"extraProperty" : @"extraValue"
};

SEGTrackPayload *trackPayload = [[SEGTrackPayload alloc] initWithEvent:@"Completed Order"
properties:properties
context:nil
integrations:nil];
[appboyIntegration track:trackPayload];
OCMVerifyAllWithDelay(appboyMock, 2);
});

it(@"calls logPurchase for each product in the products array", ^{
NSDictionary *settings = @{@"apiKey":@"foo"};
Expand Down Expand Up @@ -178,12 +202,12 @@
});

describe(@"flush", ^{
it(@"calls [[Appboy sharedInstance] flushDataAndProcessRequestQueue]", ^{
it(@"calls [[Appboy sharedInstance] requestImmediateDataFlush]", ^{
NSDictionary *settings = @{@"apiKey":@"foo"};
id appboyMock = OCMClassMock([Appboy class]);
OCMStub([appboyMock sharedInstance]).andReturn(appboyMock);
OCMExpect([appboyMock startWithApiKey:@"foo" inApplication:[OCMArg any] withLaunchOptions:nil withAppboyOptions:[OCMArg any]]);
OCMExpect([appboyMock flushDataAndProcessRequestQueue]);
OCMExpect([appboyMock requestImmediateDataFlush]);
SEGAppboyIntegration *appboyIntegration = [[SEGAppboyIntegration alloc] initWithSettings:settings];
[appboyIntegration flush];
OCMVerifyAllWithDelay(appboyMock, 2);
Expand Down
33 changes: 0 additions & 33 deletions CocoapodsExample/fastlane/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions CocoapodsExample/fastlane/report.xml

This file was deleted.

7 changes: 4 additions & 3 deletions Pod/Classes/SEGAppboyIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ - (void)track:(SEGTrackPayload *)payload
}

NSDecimalNumber *revenue = [SEGAppboyIntegration extractRevenue:payload.properties withKey:@"revenue"];
if (revenue || [payload.event isEqualToString:@"Order Completed"]) {
if (revenue || [payload.event isEqualToString:@"Order Completed"]
|| [payload.event isEqualToString:@"Completed Order"]) {
NSString *currency = @"USD"; // Make USD as the default currency.
if ([payload.properties[@"currency"] isKindOfClass:[NSString class]] &&
[(NSString *)payload.properties[@"currency"] length] == 3) { // Currency should be an ISO 4217 currency code.
Expand Down Expand Up @@ -267,8 +268,8 @@ + (NSDecimalNumber *)extractRevenue:(NSDictionary *)dictionary withKey:(NSString

- (void)flush
{
[[Appboy sharedInstance] flushDataAndProcessRequestQueue];
SEGLog(@"[[Appboy sharedInstance] flushDataAndProcessRequestQueue]");
[[Appboy sharedInstance] requestImmediateDataFlush];
SEGLog(@"[[Appboy sharedInstance] requestImmediateDataFlush]");
}

#if !TARGET_OS_TV
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Follow the standard procedure to add the frameworks built/retrieved by Carthage
To install the Braze integration through Swift Package Manager, follow these steps:

- Select `File > Swift Packages > Add Package Dependency`.
- In the search bar, enter https://github.com/Appboy/segment-ios. Select either `Full-SDK` or `Core`, depending on your use case.
- In the search bar, enter https://github.com/Appboy/appboy-segment-ios. Select either `Full-SDK` or `Core`, depending on your use case.
- In your app's target, under `Build Settings > Other Linker Flags`, add the `-ObjC` linker flag.
- In the Xcode menu, click `Product > Scheme > Edit Scheme...`
- Click the expand ▶️ next to `Build` and select `Post-actions`. Press `+` and select `New Run Script Action`.
Expand All @@ -62,13 +62,16 @@ bash "$BUILT_PRODUCTS_DIR/Appboy_iOS_SDK_AppboyKit.bundle/Appboy.bundle/appboy-s

After adding the dependency, you must register the integration with our SDK. To do this, import the Braze integration in your AppDelegate:


```
#import "SEGAppboyIntegrationFactory.h"
```

**Note:** When using Swift Package Manager, you will need to import the SDK using `import Full_SDK` or `import Core` depending on which package you are using.

And add the following lines:

#### Objective-C

```
NSString *const SEGMENT_WRITE_KEY = @" ... ";
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:SEGMENT_WRITE_KEY];
Expand All @@ -78,6 +81,17 @@ SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWith
[SEGAnalytics setupWithConfiguration:config];
```

#### Swift

```
let SEGMENT_WRITE_KEY = " ... "
let config = SEGAnalyticsConfiguration(writeKey: SEGMENT_WRITE_KEY)
config.use(SEGAppboyIntegrationFactory.instance())
SEGAnalytics.setup(with: config)
```

Please see [our documentation](https://segment.com/docs/integrations/appboy/#ios) for more information.

## License
Expand Down
4 changes: 2 additions & 2 deletions 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 = "4.2.0"
s.version = "4.3.0"
s.summary = "Braze Integration for Segment's analytics-ios library."

s.description = <<-DESC
Expand Down Expand Up @@ -29,7 +29,7 @@ Pod::Spec.new do |s|

s.subspec 'tvOS' do |tv|
tv.platform = :tvos, '11.0'
tv.dependency 'Appboy-tvOS-SDK', '~>3.27.0'
tv.dependency 'Appboy-tvOS-SDK', '~>4.3.0'
tv.source_files = 'Pod/Classes/**/*'
end

Expand Down
2 changes: 1 addition & 1 deletion Segment_Appboy.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "4.2.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.2.0/Segment_Appboy.framework.zip", "4.0.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.0.0/Segment_Appboy.framework.zip", "3.6.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.1/Segment_Appboy.framework.zip", "3.6.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.0/Segment_Appboy.framework.zip", "3.5.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.5.0/Segment_Appboy.framework.zip", "3.4.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.1/Segment_Appboy.framework.zip", "3.4.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.0/Segment_Appboy.framework.zip", "3.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.3.0/Segment_Appboy.framework.zip", "3.2.0" : "https://github.com/Appboy/appboy-segment-ios/releases/download/3.2.0/Segment_Appboy.framework.zip"}
{ "4.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.3.0/Segment_Appboy.framework.zip", "4.2.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.2.0/Segment_Appboy.framework.zip", "4.0.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/4.0.0/Segment_Appboy.framework.zip", "3.6.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.1/Segment_Appboy.framework.zip", "3.6.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.6.0/Segment_Appboy.framework.zip", "3.5.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.5.0/Segment_Appboy.framework.zip", "3.4.1": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.1/Segment_Appboy.framework.zip", "3.4.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.4.0/Segment_Appboy.framework.zip", "3.3.0": "https://github.com/Appboy/appboy-segment-ios/releases/download/3.3.0/Segment_Appboy.framework.zip", "3.2.0" : "https://github.com/Appboy/appboy-segment-ios/releases/download/3.2.0/Segment_Appboy.framework.zip"}

0 comments on commit 098dacd

Please sign in to comment.