Skip to content

Commit

Permalink
Updating Braze SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
hokstuff committed Dec 3, 2021
1 parent 2544e20 commit 23ec2e8
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 42 deletions.
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.0"
s.version = "4.4.1"
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
4 changes: 3 additions & 1 deletion AppboyKit/ABKModalWebViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ - (void)dealloc {
*
*/
- (WKWebView *)getWebView {
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero];
WKWebViewConfiguration *webViewConfiguration = [[WKWebViewConfiguration alloc] init];
webViewConfiguration.allowsInlineMediaPlayback = YES;
WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:webViewConfiguration];
webView.navigationDelegate = self;
return webView;
}
Expand Down
11 changes: 6 additions & 5 deletions AppboyKit/include/ABKInAppMessageController.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ NS_ASSUME_NONNULL_BEGIN
- (NSInteger)inAppMessagesRemainingOnStack;

/*!
* @param newInAppMessage A new in-app message that will be added into the top of the stack of in-app messages that haven't been displayed yet.
* @discussion This method allows you to request display of an in-app message. It adds the in-app message object to the top of the in-app message stack
* and tries to display it immediately.
*
* @discussion This method allows you to display a custom in-app message. It adds the in-app message object to the top of the in-app message stack
* and tries to display immediately.
* If you add an ABKInAppMessage instance that you received through a Braze delegate method - i.e. one that is associated with a campaign or Canvas,
* then impression and click analytics will work automatically. If you add an ABKInAppMessage instance that you instantiated yourself programmatically
* (uncommon), then analytics will not be available.
*
* Note: Clicks and impressions of in-app messages added by this method will not be collected by Braze and will not be
* reflected on the dashboard.
* @param newInAppMessage the in-app message to add.
*/
- (void)addInAppMessage:(ABKInAppMessage *)newInAppMessage;

Expand Down
5 changes: 3 additions & 2 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.0"
#define APPBOY_SDK_VERSION @"4.4.1"
#endif

#if !TARGET_OS_TV
Expand Down Expand Up @@ -389,7 +389,8 @@ typedef NS_ENUM(NSInteger, ABKChannel) {
* @param userId The new user's ID (from the host application).
*
* @discussion
* This method changes the user's ID.
* This method changes the user's ID. These user IDs should be private and not easily obtained (e.g. not a plain
* email address or username).
*
* When you first start using Braze on a device, the user is considered "anonymous". You can use this method to
* optionally identify a user with a unique ID, which enables the following:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ - (void)setUpEmptyFeedLabel {
self.emptyFeedLabel = [[UILabel alloc] init];
self.emptyFeedLabel.font = [ABKUIUtils preferredFontForTextStyle:UIFontTextStyleBody weight:UIFontWeightRegular];
self.emptyFeedLabel.textAlignment = NSTextAlignmentCenter;
self.emptyFeedLabel.numberOfLines = 2;
self.emptyFeedLabel.numberOfLines = 0;
self.emptyFeedLabel.translatesAutoresizingMaskIntoConstraints = NO;
}

Expand All @@ -98,7 +98,13 @@ - (void)setUpEmptyFeedView {

NSLayoutConstraint *centerXConstraint = [self.emptyFeedLabel.centerXAnchor constraintEqualToAnchor:self.emptyFeedView.centerXAnchor];
NSLayoutConstraint *centerYConstraint = [self.emptyFeedLabel.centerYAnchor constraintEqualToAnchor:self.emptyFeedView.centerYAnchor];
[NSLayoutConstraint activateConstraints:@[centerXConstraint, centerYConstraint]];
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 activateConstraints:@[centerXConstraint, centerYConstraint,
leftConstraint, rightConstraint,
topConstraint, bottomConstraint]];
}

- (void)dealloc {
Expand Down
7 changes: 3 additions & 4 deletions AppboyUI/ABKInAppMessage/ABKInAppMessageUIDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ NS_ASSUME_NONNULL_BEGIN
* * make the in-app message clickable when there is no button(s) on it.
* * stretch/shrink the in-app message view to fix the whole screen.
*
* NOTE: The returned view controller should be a ABKInAppMessageViewController or preferably, a subclass of
* ABKInAppMessageViewController. The view of the returned view controller should be an instance of ABKInAppMessageView or its
* subclass.
* @returns An ABKInAppMessageViewController subclass for which the view is an ABKInAppMessageView
* instance or subclass. Returning nil will prevent the in-app message from displaying.
*/
- (ABKInAppMessageViewController *)inAppMessageViewControllerWithInAppMessage:(ABKInAppMessage *)inAppMessage;
- (nullable ABKInAppMessageViewController *)inAppMessageViewControllerWithInAppMessage:(ABKInAppMessage *)inAppMessage;

/*!
* @param inAppMessage The in-app message object being offered to the delegate.
Expand Down
19 changes: 12 additions & 7 deletions AppboyUI/ABKInAppMessage/ABKInAppMessageWindow.m
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
#import "ABKInAppMessageWindow.h"
#import "ABKInAppMessageView.h"
#import "ABKInAppMessageWindowController.h"
#import "ABKInAppMessageHTMLBase.h"
#import "ABKUIUtils.h"

@implementation ABKInAppMessageWindow

// Touches handled by ABKInAppMessageWindow:
// - all if `handleAllTouchEvents == YES`
// - in `ABKInAppMessageView` or one of its subviews
// - in `UIAlertController` or one of its previous responder so that alerts
// presented can be interacted with (e.g. `window.alert()` in an HTML in-app
// message)
// - in any of the native WebKit UI elements (e.g. popovers)
// - all if displaying an HTML in-app message
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {

// Get the view in the hierarchy that contains the point
UIView *hitTestResult = [super hitTest:point withEvent:event];

// Always returns the view for HTML in-app messages
if ([self.rootViewController isKindOfClass:[ABKInAppMessageWindowController class]]) {
ABKInAppMessageWindowController *controller = (ABKInAppMessageWindowController *)self.rootViewController;
if ([controller.inAppMessage isKindOfClass:[ABKInAppMessageHTMLBase class]]) {
return hitTestResult;
}
}

// Handles the touch event
if (self.handleAllTouchEvents ||
[ABKUIUtils responderChainOf:hitTestResult hasKindOfClass:[ABKInAppMessageView class]] ||
[ABKUIUtils responderChainOf:hitTestResult hasKindOfClass:[UIAlertController class]] ||
[ABKUIUtils responderChainOf:hitTestResult hasClassPrefixedWith:@"WK"]) {
[ABKUIUtils responderChainOf:hitTestResult hasKindOfClass:[ABKInAppMessageView class]]) {
return hitTestResult;
}

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 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 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
- Changed `ABKInAppMessageUIDelegate.inAppMessageViewControllerWithInAppMessage:` to accept a `nil` return value.

##### Added
- Adds support for the `playsinline` attribute on HTML `<video>` elements within webpages that are opened in the app by Braze.
- Adds XCFramework support for the Core integration via Carthage. Please follow the [Carthage migration guide](https://github.com/Carthage/Carthage#migrating-a-project-from-framework-bundles-to-xcframeworks) when transitioning to the new artifact.

## 4.4.0

##### Breaking
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 @@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.4.0</string>
<string>4.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
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.0/AppboyKitLibrary.xcframework.zip",
checksum: "34a7056db4ae1e24caa8933f6d98694f4baa1652fafb1c457570e9955ee2d8ec"
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.1/AppboyKitLibrary.xcframework.zip",
checksum: "4a7ed372331828676f55ebd389721ae8f6980999c157939a57b5203764f1dd38"
),
.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.0/AppboyPushStoryFramework.xcframework.zip",
checksum: "b8695594e57f6c0d7235d49dc875dd4c4468cbb31c2de61db0ac1204f4cc8235"
url: "https://github.com/Appboy/appboy-ios-sdk/releases/download/4.4.1/AppboyPushStoryFramework.xcframework.zip",
checksum: "769d695b72772921ef645a16f1f5632bfcab24a6455c3973594e24f51897e5bc"
),
.target(
name: "AppboyPushStory",
Expand Down
16 changes: 9 additions & 7 deletions Samples/Core/ObjCSample/ObjCSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
TargetAttributes = {
C0FC8B171F95196B00841660 = {
CreatedOnToolsVersion = 9.0;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
Expand Down Expand Up @@ -363,14 +363,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ObjCSample/ObjCSample.entitlements;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5GLZKGNWQ3;
INFOPLIST_FILE = ObjCSample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.appboy.ObjCSample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "b74edbb6-5371-44cd-a39c-b75ee2d32d9b";
PROVISIONING_PROFILE_SPECIFIER = "match Development com.appboy.ObjCSample";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -381,14 +382,15 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ObjCSample/ObjCSample.entitlements;
CODE_SIGN_STYLE = Manual;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5GLZKGNWQ3;
INFOPLIST_FILE = ObjCSample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.appboy.ObjCSample;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "40c7d041-099c-4fa3-a48f-48c9c14f9045";
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc com.appboy.ObjCSample";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
4 changes: 4 additions & 0 deletions Samples/Core/ObjCSample/ObjCSample/ObjCSample.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
10 changes: 10 additions & 0 deletions Samples/Core/ObjCSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ target 'ObjCSample' do
pod 'Appboy-iOS-SDK/Core'
end

post_install do |installer|
installer.pods_project.targets.each do |target|
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY[sdk=macosx*]'] = '-'
end
end
end
end
10 changes: 5 additions & 5 deletions Samples/Core/ObjCSample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Appboy-iOS-SDK/Core (4.3.0)
- Appboy-iOS-SDK/Core (4.4.0)

DEPENDENCIES:
- Appboy-iOS-SDK/Core

SPEC REPOS:
trunk:
https://github.com/CocoaPods/Specs.git:
- Appboy-iOS-SDK

SPEC CHECKSUMS:
Appboy-iOS-SDK: dade18b2f6dc5c058669367c558ed87f389e4eea
Appboy-iOS-SDK: ed0d3b4ae3d3dec2248a4921b9cdd12f52737ceb

PODFILE CHECKSUM: d86052a336290ae6183527d938415bfa4f522394
PODFILE CHECKSUM: 981ca4ca49268d708fd5ef1d05e665b5dd4aadb7

COCOAPODS: 1.10.1
COCOAPODS: 1.11.2
Loading

0 comments on commit 23ec2e8

Please sign in to comment.