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 6d76601 commit b751de2
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 15 deletions.
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
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "AppboyKitLibrary",
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.2/AppboyKitLibrary.xcframework.zip",
checksum: "8af8194536bcbd83247f7239815ee01676d3a1587ef63849e047b671cad60f43"
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.3/AppboyKitLibrary.xcframework.zip",
checksum: "66f13ebff3323d7eeccfba4fb67ab2174402a2b021c6b5a28990737316041510"
),
.target(
name: "AppboyKit",
Expand Down Expand Up @@ -53,8 +53,8 @@ let package = Package(
),
.binaryTarget(
name: "AppboyPushStoryFramework",
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.2/AppboyPushStoryFramework.xcframework.zip",
checksum: "7b376545e163bca7482a1a52ef742315350f095da107de79048d654ca5d49714"
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.3/AppboyPushStoryFramework.xcframework.zip",
checksum: "950a16e8d8ad665f92986d4d0af405316ea28b2655228ac798d0f156ca892718"
),
.target(
name: "AppboyPushStory",
Expand Down

0 comments on commit b751de2

Please sign in to comment.