Skip to content

Commit

Permalink
Updating Braze SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Apr 15, 2022
1 parent 6957ffd commit 228cfc0
Show file tree
Hide file tree
Showing 22 changed files with 458 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 🐞 Bug report
description: File a Bug Report for unexpected or incorrect SDK Behavior
title: '[Bug]: '
labels: ["bug","triage"]
labels: ["bug"]
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -37,7 +37,7 @@ body:
id: xcode_version
attributes:
label: Xcode Version
placeholder: ex. Xcode 13.2
placeholder: ex. Xcode 10.1
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ✅ Feature Request
description: Request New SDK Features
title: '[Feature]: '
labels: ["feature-request","triage"]
labels: ["feature-request"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion Appboy-iOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Appboy-iOS-SDK"
s.version = "4.4.2"
s.version = "4.4.3"
s.summary = "This is the Braze iOS SDK for Mobile Marketing Automation"
s.homepage = "http://www.braze.com"
s.license = { :type => 'Commercial', :text => 'Please refer to https://github.com/Appboy/appboy-ios-sdk/blob/master/LICENSE'}
Expand Down
2 changes: 1 addition & 1 deletion Appboy-tvOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Appboy-tvOS-SDK"
s.version = "4.3.2"
s.version = "4.4.3"
s.summary = "This is the Braze tvOS SDK for Mobile Marketing Automation"
s.homepage = "http://www.braze.com"
s.license = { :type => 'Commercial', :text => 'Please refer to https://github.com/Appboy/appboy-ios-sdk/blob/master/LICENSE'}
Expand Down
Binary file modified AppboyKit/Appboy.bundle/Info.plist
Binary file not shown.
8 changes: 4 additions & 4 deletions AppboyKit/include/ABKInAppMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ typedef NS_ENUM(NSInteger, ABKInAppMessageOrientation) {
* Default icon and in-app message button background colors.
* These are used in the in-app message view controllers.
*/
static CGFloat const RedValueOfDefaultIconColorAndButtonBgColor = 0.0f;
static CGFloat const GreenValueOfDefaultIconColorAndButtonBgColor = 115.0f / 255.0f;
static CGFloat const BlueValueOfDefaultIconColorAndButtonBgColor = 213.0f / 255.0f;
static CGFloat const AlphaValueOfDefaultIconColorAndButtonBgColor = 1.0f;
static CGFloat const RedValueOfDefaultIconColorAndButtonBgColor = (CGFloat)0.0f;
static CGFloat const GreenValueOfDefaultIconColorAndButtonBgColor = (CGFloat)(115.0f / 255.0f);
static CGFloat const BlueValueOfDefaultIconColorAndButtonBgColor = (CGFloat)(213.0f / 255.0f);
static CGFloat const AlphaValueOfDefaultIconColorAndButtonBgColor = (CGFloat)1.0f;

/*
* Braze Public API: ABKInAppMessage
Expand Down
2 changes: 1 addition & 1 deletion AppboyKit/include/Appboy.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import "ABKSdkMetadata.h"

#ifndef APPBOY_SDK_VERSION
#define APPBOY_SDK_VERSION @"4.4.2"
#define APPBOY_SDK_VERSION @"4.4.3"
#endif

#if !TARGET_OS_TV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@property (strong, nonatomic) IBOutlet UILabel *descriptionLabel;
@property (strong, nonatomic) IBOutlet UILabel *linkLabel;

@property (nonatomic, assign) CGFloat padding;

- (void)applyCard:(ABKCaptionedImageContentCard *)captionedImageCard;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ - (UILabel *)linkLabel {

#pragma mark - SetUp

- (void)setUp {
[super setUp];
self.padding = 25;
}

- (void)setUpUI {
[super setUpUI];

Expand All @@ -151,7 +156,7 @@ - (void)setUpUI {
self.imageRatioConstraint,

// Pin Image
[self.pinImageView.topAnchor constraintEqualToAnchor:self.captionedImageView.bottomAnchor],
[self.pinImageView.topAnchor constraintEqualToAnchor:self.captionedImageView.topAnchor],
[self.pinImageView.trailingAnchor constraintEqualToAnchor:self.rootView.trailingAnchor],
[self.pinImageView.widthAnchor constraintEqualToConstant:20],
[self.pinImageView.heightAnchor constraintEqualToConstant:20],
Expand All @@ -160,9 +165,9 @@ - (void)setUpUI {
[self.titleLabel.topAnchor constraintEqualToAnchor:self.captionedImageView.bottomAnchor
constant:17],
[self.titleLabel.leadingAnchor constraintEqualToAnchor:self.rootView.leadingAnchor
constant:25],
constant:self.padding],
[self.titleLabel.trailingAnchor constraintEqualToAnchor:self.rootView.trailingAnchor
constant:-25],
constant:-self.padding],

// Description
[self.descriptionLabel.topAnchor constraintEqualToAnchor:self.titleLabel.bottomAnchor
Expand All @@ -178,14 +183,14 @@ - (void)setUpUI {

self.descriptionConstraints = @[
[self.descriptionLabel.bottomAnchor constraintEqualToAnchor:self.rootView.bottomAnchor
constant:-25]
constant:-self.padding]
];

self.linkConstraints = @[
[self.linkLabel.topAnchor constraintEqualToAnchor:self.descriptionLabel.bottomAnchor
constant:8],
[self.linkLabel.bottomAnchor constraintEqualToAnchor:self.rootView.bottomAnchor
constant:-25]
constant:-self.padding]
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ @interface ABKInAppMessageWindowController ()

@property (nonatomic, assign) NSInteger keyWindowRetryCount;

@property (nonatomic, assign) BOOL isRemovingWindow;

@end

@implementation ABKInAppMessageWindowController
Expand All @@ -41,6 +43,7 @@ - (instancetype)initWithInAppMessage:(ABKInAppMessage *)inAppMessage
_inAppMessageIsTapped = NO;
_clickedButtonId = -1;
_keyWindowRetryCount = 0;
_isRemovingWindow = NO;
}
return self;
}
Expand Down Expand Up @@ -281,6 +284,10 @@ - (void)handleWindowDidBecomeKeyNotification:(NSNotification *)notification {
selector:@selector(resetKeyWindowRetryCount)
object:nil];

// Skip if this in-app message is already removing the window
if (self.isRemovingWindow) {
return;
}
// Skip for any in-app message window
if ([window isKindOfClass:[ABKInAppMessageWindow class]]) {
return;
Expand Down Expand Up @@ -376,10 +383,18 @@ - (void)hideInAppMessageViewWithAnimation:(BOOL)withAnimation
}

- (void)hideInAppMessageWindow {
if (self.isRemovingWindow) {
return;
}
self.isRemovingWindow = YES;

[self.slideAwayTimer invalidate];
self.slideAwayTimer = nil;

self.inAppMessageWindow.rootViewController = nil;
if (@available(iOS 13.0, *)) {
self.inAppMessageWindow.windowScene = nil;
}
self.inAppMessageWindow = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:ABKNotificationInAppMessageWindowDismissed
object:self
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import <UIKit/UIKit.h>
#import <SDWebImage/SDAnimatedImageView+WebCache.h>
#import "ABKCard.h"

@protocol ABKBaseNewsFeedCellDelegate <NSObject>
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 4.4.3

##### Fixed
- Fixes an issue introduced in `4.4.0` which prevented custom events or purchases with an empty dictionary of properties from being logged.
- Improves handling of `ABKInAppMessageWindow`'s dismissal to promptly remove it from the view hierarchy.
- Fixes the position of the pinned indicator for _Captioned Image_ Content Cards when using the default UI.
- Fixes an issue introduced in `4.3.2` and limited to users of `Appboy-tvOS-SDK`, which prevented custom events with properties or purchases with properties from being logged.

##### Added
- Adds a `padding` property to `ABKCaptionedImageContentCardCell` to support modifying the default value.

## 4.4.2

##### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Example/Stopwatch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Apple Development";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 4.4.2;
CURRENT_PROJECT_VERSION = 4.4.3;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand Down Expand Up @@ -1357,7 +1357,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Apple Distribution";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 4.4.2;
CURRENT_PROJECT_VERSION = 4.4.3;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down
2 changes: 1 addition & 1 deletion Example/Stopwatch/Supporting Files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<key>CFBundleShortVersionString</key>
<string>4.4.2</string>
<string>4.4.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleDevelopmentRegion</key>
Expand Down
6 changes: 5 additions & 1 deletion Example/tvOS_TVML_Stopwatch/AppboyBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ - (void)changeUser:(NSString *)userId {
[[Appboy sharedInstance] changeUser:[userId stringByAppendingString:[NSString stringWithFormat:@"%.0f", [[NSDate date] timeIntervalSince1970]]]];
}
- (void)logCustomEventsAndPurchases {
[[Appboy sharedInstance] logCustomEvent:@"tvOSCustomEvent"];
[[Appboy sharedInstance] logCustomEvent:@"tvOS_TVML_Event_noProps"];
[[Appboy sharedInstance] logCustomEvent:@"tvOS_TVML_Event" withProperties:@{@"tvOS_TVML_EventPKey" : @123}];

[[Appboy sharedInstance] logPurchase:@"tvOS_TVML_Purchase_noProps" inCurrency:@"USD" atPrice:[[NSDecimalNumber alloc] initWithString:@"0.11"] withQuantity:1];
[[Appboy sharedInstance] logPurchase:@"tvOS_TVML_Purchase" inCurrency:@"USD" atPrice:[[NSDecimalNumber alloc] initWithString:@"0.88"] withQuantity:2 andProperties:@{@"tvOS_TVML_PurchasePKey" : @456}];
}
- (void)logAttributes {
[[Appboy sharedInstance].user setLastName:@"West"];
Expand Down
Loading

0 comments on commit 228cfc0

Please sign in to comment.