Skip to content

Commit 3d019dd

Browse files
committed
Updating Braze SDK
1 parent 23ec2e8 commit 3d019dd

File tree

56 files changed

+123
-1258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+123
-1258
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,5 @@ xcuserdata/
1313
# Emacs temporary files
1414
*~
1515

16-
# Fastlane Autogenerated files
17-
**/fastlane/README.md
18-
**/fastlane/report.xml
19-
2016
# XCFrameworks
2117
*.xcframework

Appboy-iOS-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Appboy-iOS-SDK"
3-
s.version = "4.4.1"
3+
s.version = "4.4.2"
44
s.summary = "This is the Braze iOS SDK for Mobile Marketing Automation"
55
s.homepage = "http://www.braze.com"
66
s.license = { :type => 'Commercial', :text => 'Please refer to https://github.com/Appboy/appboy-ios-sdk/blob/master/LICENSE'}

AppboyKit/Appboy.bundle/Info.plist

-3 Bytes
Binary file not shown.

AppboyKit/include/ABKBannerCard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
1818
@property (copy, nullable) NSString *domain;
1919

2020
/*
21-
* This property is the aspect ratio of the card's image.
21+
* This property is the aspect ratio of the card's image. It is meant to serve as a hint before
22+
* image loading completes. Note that the property may not be supplied in certain circumstances.
2223
*/
2324
@property float imageAspectRatio;
2425

AppboyKit/include/ABKBannerContentCard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
@property (copy) NSString *image;
99

1010
/*
11-
* This property is the aspect ratio of the card's image.
11+
* This property is the aspect ratio of the card's image. It is meant to serve as a hint before
12+
* image loading completes. Note that the property may not be supplied in certain circumstances.
1213
*/
1314
@property float imageAspectRatio;
1415

AppboyKit/include/ABKCaptionedImageCard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
1212
@property (copy) NSString *image;
1313

1414
/*
15-
* This property is the aspect ratio of the card's image.
15+
* This property is the aspect ratio of the card's image. It is meant to serve as a hint before
16+
* image loading completes. Note that the property may not be supplied in certain circumstances.
1617
*/
1718
@property float imageAspectRatio;
1819

AppboyKit/include/ABKCaptionedImageContentCard.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ NS_ASSUME_NONNULL_BEGIN
99
@property (copy) NSString *image;
1010

1111
/*
12-
* This property is the aspect ratio of the card's image.
12+
* This property is the aspect ratio of the card's image. It is meant to serve as a hint before
13+
* image loading completes. Note that the property may not be supplied in certain circumstances.
1314
*/
1415
@property float imageAspectRatio;
1516

AppboyKit/include/Appboy.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#import "ABKSdkMetadata.h"
1616

1717
#ifndef APPBOY_SDK_VERSION
18-
#define APPBOY_SDK_VERSION @"4.4.1"
18+
#define APPBOY_SDK_VERSION @"4.4.2"
1919
#endif
2020

2121
#if !TARGET_OS_TV
@@ -154,6 +154,8 @@ extern NSString *const ABKDeviceAllowlistKey;
154154
*/
155155
extern NSString *const ABKDeviceWhitelistKey __deprecated_msg("ABKDeviceWhitelistKey is deprecated. Please use ABKDeviceAllowlistKey instead.");
156156

157+
extern NSString *const ABKEphemeralEventsKey;
158+
157159
/*!
158160
* This key can be set to a string value representing the app group name for the Push Story Notification
159161
* Content extension. This is required for the SDK to fetch data from and handle user interactions
@@ -279,8 +281,7 @@ typedef NS_ENUM(NSInteger, ABKChannel) {
279281
* @param apiKey The app's API key
280282
* @param application The current app
281283
* @param launchOptions The options NSDictionary that you get from application:didFinishLaunchingWithOptions
282-
* @param appboyOptions An optional NSDictionary with startup configuration values for Braze. This currently supports
283-
* ABKRequestProcessingPolicyOptionKey, ABKSocialAccountAcquisitionPolicyOptionKey and ABKFlushIntervalOptionKey. See below
284+
* @param appboyOptions An optional NSDictionary with startup configuration values for Braze. See below
284285
* for more information.
285286
*
286287
* @discussion Starts up Braze and tells it that your app is done launching. You should call this

AppboyUI/ABKContentCards/ViewControllers/ABKContentCardsTableViewController.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ - (void)setUpUI {
8686
- (void)setUpEmptyFeedLabel {
8787
self.emptyFeedLabel = [[UILabel alloc] init];
8888
self.emptyFeedLabel.font = [ABKUIUtils preferredFontForTextStyle:UIFontTextStyleBody weight:UIFontWeightRegular];
89+
self.emptyFeedLabel.adjustsFontSizeToFitWidth = YES;
90+
self.emptyFeedLabel.adjustsFontForContentSizeCategory = YES;
8991
self.emptyFeedLabel.textAlignment = NSTextAlignmentCenter;
9092
self.emptyFeedLabel.numberOfLines = 0;
9193
self.emptyFeedLabel.translatesAutoresizingMaskIntoConstraints = NO;
@@ -95,15 +97,16 @@ - (void)setUpEmptyFeedView {
9597
self.emptyFeedView = [[UIView alloc] init];
9698
self.emptyFeedView.backgroundColor = [UIColor clearColor];
9799
[self.emptyFeedView addSubview:self.emptyFeedLabel];
100+
self.edgesForExtendedLayout = UIRectEdgeNone;
98101

99102
NSLayoutConstraint *centerXConstraint = [self.emptyFeedLabel.centerXAnchor constraintEqualToAnchor:self.emptyFeedView.centerXAnchor];
100103
NSLayoutConstraint *centerYConstraint = [self.emptyFeedLabel.centerYAnchor constraintEqualToAnchor:self.emptyFeedView.centerYAnchor];
101-
NSLayoutConstraint *leftConstraint = [self.emptyFeedLabel.leftAnchor constraintEqualToAnchor:self.emptyFeedView.leftAnchor];
102-
NSLayoutConstraint *rightConstraint = [self.emptyFeedLabel.rightAnchor constraintEqualToAnchor:self.emptyFeedView.rightAnchor];
103-
NSLayoutConstraint *topConstraint = [self.emptyFeedLabel.topAnchor constraintEqualToAnchor:self.emptyFeedView.topAnchor];
104-
NSLayoutConstraint *bottomConstraint = [self.emptyFeedLabel.bottomAnchor constraintEqualToAnchor:self.emptyFeedView.bottomAnchor];
104+
NSLayoutConstraint *leadingConstraint = [self.emptyFeedLabel.leadingAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.leadingAnchor];
105+
NSLayoutConstraint *trailingConstraint = [self.emptyFeedLabel.trailingAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.trailingAnchor];
106+
NSLayoutConstraint *topConstraint = [self.emptyFeedLabel.topAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.topAnchor];
107+
NSLayoutConstraint *bottomConstraint = [self.emptyFeedLabel.bottomAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.bottomAnchor];
105108
[NSLayoutConstraint activateConstraints:@[centerXConstraint, centerYConstraint,
106-
leftConstraint, rightConstraint,
109+
leadingConstraint, trailingConstraint,
107110
topConstraint, bottomConstraint]];
108111
}
109112

AppboyUI/ABKInAppMessage/ViewControllers/ABKInAppMessageWindowController.m

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,18 @@ - (void)keyboardWasShown {
254254

255255
#pragma mark - Windows
256256

257+
- (void)resetKeyWindowRetryCount {
258+
self.keyWindowRetryCount = 0;
259+
}
260+
257261
/*!
258262
* React to windows changes in the view hierarchy. This is needed to ensure that the in-app message
259263
* stays visible in cases where the host app decides to display a window (possibly the app's main
260264
* window) over our in-app message.
261265
*
262-
* This method tries to make the in-app message window visible up to 10 times. The in-app message
263-
* is dismissed when reaching that value to prevent infinite loops when another window in the view
264-
* hierarchy has a similar behavior.
266+
* This method tries to make the in-app message window visible up to 10 times — debounced with a
267+
* 0.1s timeout. The in-app message is dismissed when reaching that value to prevent infinite loops
268+
* when another window in the view hierarchy has a similar behavior.
265269
*
266270
* e.g. Some clients have extra logic when bootstrapping their app that can lead to the app's main
267271
* window being made key and visible after a delay at startup. In the case of test in-app messages
@@ -272,6 +276,11 @@ - (void)keyboardWasShown {
272276
- (void)handleWindowDidBecomeKeyNotification:(NSNotification *)notification {
273277
UIWindow *window = notification.object;
274278

279+
// Cancel debounced reset
280+
[NSObject cancelPreviousPerformRequestsWithTarget:self
281+
selector:@selector(resetKeyWindowRetryCount)
282+
object:nil];
283+
275284
// Skip for any in-app message window
276285
if ([window isKindOfClass:[ABKInAppMessageWindow class]]) {
277286
return;
@@ -292,6 +301,13 @@ - (void)handleWindowDidBecomeKeyNotification:(NSNotification *)notification {
292301

293302
// Force in-app message window to be displayed
294303
[self.inAppMessageWindow makeKeyAndVisible];
304+
305+
// Debounced reset, use NSRunLoopCommonModes as NSDefaultRunLoopMode does not update during
306+
// scroll events.
307+
[self performSelector:@selector(resetKeyWindowRetryCount)
308+
withObject:nil
309+
afterDelay:0.1
310+
inModes:@[NSRunLoopCommonModes]];
295311
}
296312

297313
#pragma mark - Display and Hide In-app Message

0 commit comments

Comments
 (0)