Skip to content

Commit

Permalink
Updating Braze SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Jan 24, 2022
1 parent 23ec2e8 commit 3d019dd
Show file tree
Hide file tree
Showing 56 changed files with 123 additions and 1,258 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,5 @@ xcuserdata/
# Emacs temporary files
*~

# Fastlane Autogenerated files
**/fastlane/README.md
**/fastlane/report.xml

# XCFrameworks
*.xcframework
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.1"
s.version = "4.4.2"
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
Binary file modified AppboyKit/Appboy.bundle/Info.plist
Binary file not shown.
3 changes: 2 additions & 1 deletion AppboyKit/include/ABKBannerCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (copy, nullable) NSString *domain;

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

Expand Down
3 changes: 2 additions & 1 deletion AppboyKit/include/ABKBannerContentCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
@property (copy) NSString *image;

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

Expand Down
3 changes: 2 additions & 1 deletion AppboyKit/include/ABKCaptionedImageCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (copy) NSString *image;

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

Expand Down
3 changes: 2 additions & 1 deletion AppboyKit/include/ABKCaptionedImageContentCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (copy) NSString *image;

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

Expand Down
7 changes: 4 additions & 3 deletions 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.1"
#define APPBOY_SDK_VERSION @"4.4.2"
#endif

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

extern NSString *const ABKEphemeralEventsKey;

/*!
* This key can be set to a string value representing the app group name for the Push Story Notification
* Content extension. This is required for the SDK to fetch data from and handle user interactions
Expand Down Expand Up @@ -279,8 +281,7 @@ typedef NS_ENUM(NSInteger, ABKChannel) {
* @param apiKey The app's API key
* @param application The current app
* @param launchOptions The options NSDictionary that you get from application:didFinishLaunchingWithOptions
* @param appboyOptions An optional NSDictionary with startup configuration values for Braze. This currently supports
* ABKRequestProcessingPolicyOptionKey, ABKSocialAccountAcquisitionPolicyOptionKey and ABKFlushIntervalOptionKey. See below
* @param appboyOptions An optional NSDictionary with startup configuration values for Braze. See below
* for more information.
*
* @discussion Starts up Braze and tells it that your app is done launching. You should call this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ - (void)setUpUI {
- (void)setUpEmptyFeedLabel {
self.emptyFeedLabel = [[UILabel alloc] init];
self.emptyFeedLabel.font = [ABKUIUtils preferredFontForTextStyle:UIFontTextStyleBody weight:UIFontWeightRegular];
self.emptyFeedLabel.adjustsFontSizeToFitWidth = YES;
self.emptyFeedLabel.adjustsFontForContentSizeCategory = YES;
self.emptyFeedLabel.textAlignment = NSTextAlignmentCenter;
self.emptyFeedLabel.numberOfLines = 0;
self.emptyFeedLabel.translatesAutoresizingMaskIntoConstraints = NO;
Expand All @@ -95,15 +97,16 @@ - (void)setUpEmptyFeedView {
self.emptyFeedView = [[UIView alloc] init];
self.emptyFeedView.backgroundColor = [UIColor clearColor];
[self.emptyFeedView addSubview:self.emptyFeedLabel];
self.edgesForExtendedLayout = UIRectEdgeNone;

NSLayoutConstraint *centerXConstraint = [self.emptyFeedLabel.centerXAnchor constraintEqualToAnchor:self.emptyFeedView.centerXAnchor];
NSLayoutConstraint *centerYConstraint = [self.emptyFeedLabel.centerYAnchor constraintEqualToAnchor:self.emptyFeedView.centerYAnchor];
NSLayoutConstraint *leftConstraint = [self.emptyFeedLabel.leftAnchor constraintEqualToAnchor:self.emptyFeedView.leftAnchor];
NSLayoutConstraint *rightConstraint = [self.emptyFeedLabel.rightAnchor constraintEqualToAnchor:self.emptyFeedView.rightAnchor];
NSLayoutConstraint *topConstraint = [self.emptyFeedLabel.topAnchor constraintEqualToAnchor:self.emptyFeedView.topAnchor];
NSLayoutConstraint *bottomConstraint = [self.emptyFeedLabel.bottomAnchor constraintEqualToAnchor:self.emptyFeedView.bottomAnchor];
NSLayoutConstraint *leadingConstraint = [self.emptyFeedLabel.leadingAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.leadingAnchor];
NSLayoutConstraint *trailingConstraint = [self.emptyFeedLabel.trailingAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.trailingAnchor];
NSLayoutConstraint *topConstraint = [self.emptyFeedLabel.topAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.topAnchor];
NSLayoutConstraint *bottomConstraint = [self.emptyFeedLabel.bottomAnchor constraintEqualToAnchor:self.emptyFeedView.layoutMarginsGuide.bottomAnchor];
[NSLayoutConstraint activateConstraints:@[centerXConstraint, centerYConstraint,
leftConstraint, rightConstraint,
leadingConstraint, trailingConstraint,
topConstraint, bottomConstraint]];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,18 @@ - (void)keyboardWasShown {

#pragma mark - Windows

- (void)resetKeyWindowRetryCount {
self.keyWindowRetryCount = 0;
}

/*!
* React to windows changes in the view hierarchy. This is needed to ensure that the in-app message
* stays visible in cases where the host app decides to display a window (possibly the app's main
* window) over our in-app message.
*
* This method tries to make the in-app message window visible up to 10 times. The in-app message
* is dismissed when reaching that value to prevent infinite loops when another window in the view
* hierarchy has a similar behavior.
* This method tries to make the in-app message window visible up to 10 times — debounced with a
* 0.1s timeout. The in-app message is dismissed when reaching that value to prevent infinite loops
* when another window in the view hierarchy has a similar behavior.
*
* e.g. Some clients have extra logic when bootstrapping their app that can lead to the app's main
* window being made key and visible after a delay at startup. In the case of test in-app messages
Expand All @@ -272,6 +276,11 @@ - (void)keyboardWasShown {
- (void)handleWindowDidBecomeKeyNotification:(NSNotification *)notification {
UIWindow *window = notification.object;

// Cancel debounced reset
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(resetKeyWindowRetryCount)
object:nil];

// Skip for any in-app message window
if ([window isKindOfClass:[ABKInAppMessageWindow class]]) {
return;
Expand All @@ -292,6 +301,13 @@ - (void)handleWindowDidBecomeKeyNotification:(NSNotification *)notification {

// Force in-app message window to be displayed
[self.inAppMessageWindow makeKeyAndVisible];

// Debounced reset, use NSRunLoopCommonModes as NSDefaultRunLoopMode does not update during
// scroll events.
[self performSelector:@selector(resetKeyWindowRetryCount)
withObject:nil
afterDelay:0.1
inModes:@[NSRunLoopCommonModes]];
}

#pragma mark - Display and Hide In-app Message
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
## 4.4.2

##### Fixed
- Fixes a bug for HTML in-app messages using the _HTML Upload with Preview_ option to improve the reliability of in-app message display.
- Fixes a bug preventing integration via Swift Package Manager in specific contexts.
- Fixes an issue in the default Content Cards UI where the empty feed label was truncated if it was too large for the screen, for example due to accessibility or localization.
- Fixes an issue where Slideup in-app messages would be automatically dismissed after multiple interaction with the app's main window.

##### Changed
- If `changeUser:sdkAuthSignature:` is called with the current user's ID, but with a new and valid SDK Authentication signature, the new signature will be used.
- Improves push tracking accuracy for apps making use of `UISceneDelegate` (UIKit) or `Scene` (SwiftUI).

## 4.4.1

##### Fixed
- Fixes an issue in which `input` elements with `type="date"` in HTML in-app messages do not respond to some user interactions on iOS 14 and iOS 15.
- Fixes `ABKSdkMetadata` availibility when using the dynamic variant of the SDK.
- Fixes `ABKSdkMetadata` availability when using the dynamic variant of the SDK.
- Fixes an issue in which the default content cards UI's empty feed label does not wrap properly when the device is using Larger Accessibility Sizes for its text size.

##### Changed
Expand Down
12 changes: 0 additions & 12 deletions Example/Matchfile

This file was deleted.

1 change: 0 additions & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ target :Stopwatch do
pod 'Appboy-iOS-SDK'
pod 'KKColorListPicker', :git => 'https://github.com/leoru/KKColorListPicker.git', :inhibit_warnings => true
pod 'Branch'
pod 'BuddyBuildSDK'
end

target :tvOS_Stopwatch do
Expand Down
Loading

0 comments on commit 3d019dd

Please sign in to comment.