Braze iOS SDK
Documentation for the Braze iOS SDK
 All Classes Functions Properties
Instance Methods | Properties | List of all members
ABKInAppMessageWindowController Class Reference

#import <ABKInAppMessageWindowController.h>

Instance Methods

(instancetype) - initWithInAppMessage:inAppMessageViewController:inAppMessageDelegate:
(void) - keyboardWasShown
(void) - displayInAppMessageViewWithAnimation:
(void) - hideInAppMessageViewWithAnimation:
(void) - hideInAppMessageViewWithAnimation:completionHandler:
(void) - inAppMessageClickedWithActionType:URL:openURLInWebView:


IBOutlet ABKInAppMessageWindowinAppMessageWindow
NSTimer * slideAwayTimer
id< ABKInAppMessageUIDelegateinAppMessageUIDelegate
CGFloat slideupConstraintMaxValue
CGPoint inAppMessagePreviousPanPosition
UIInterfaceOrientationMask supportedOrientationMask
UIInterfaceOrientation preferredOrientation
BOOL isInRotation
BOOL inAppMessageIsTapped
NSInteger clickedButtonId
NSString * clickedHTMLButtonId

Detailed Description

ABKInAppMessageWindowController is the view controller responsible for housing and displaying ABKInAppMessageViewControllers and performing actions after the in-app message is clicked. Instances of ABKInAppMessageWindowController are deallocated after the in-app message is dismissed.

It will display the given in-app message view controller by animating it onto the screen, and dismiss it by animating it off the screen, by calling the ABKInAppMessageViewController's moveInAppMessageViewOffScreen: and moveInAppMessageViewOnScreen: methods, and log an impression of the in-app message. If the in-app message view controller is an instance of ABKInAppMessageSlideupViewController, ABKInAppMessageModalViewController, or ABKInAppMessageFullViewController, it'll also handle the following behaviors:

Additionally, the view controller is responsible for executing that in-app message's specified behavior on click or performing a "custom action", which can be specified through a delegate for the in-app message.

After the in-app message is dismissed, ABKInAppMessageWindowController will set the inAppMessageWindow property to nil, and inform ABKInAppMessageUIController to set it's windowController property to nil as well. At that point, the in-app message window's retainer count will drop to 0 and the system will clean it out from the UIApplication's windows array.

Method Documentation

- (void) displayInAppMessageViewWithAnimation: (BOOL)  withAnimation

This method is called to display the in-app message.

For customization, please use a subclass or category to override this method.

- (void) hideInAppMessageViewWithAnimation: (BOOL)  withAnimation

These methods are called to hide the in-app message.

For customization, please use a subclass or category to override one of these methods.

- (void) inAppMessageClickedWithActionType: (ABKInAppMessageClickActionType)  actionType
URL: (nullable NSURL *)  url
openURLInWebView: (BOOL)  openUrlInWebView 

This method is called when an in-app message button is clicked.

For customization, please use a subclass or category to override this method.

- (void) keyboardWasShown

This method is called when the keyboard is shown when an in-app message is being displayed.

For customization, please use a subclass or category to override this method.

Property Documentation

- (NSInteger) clickedButtonId

The ID of a button that has been clicked.

- (NSString*) clickedHTMLButtonId

The ID of an HTML button that has been clicked.

- (ABKInAppMessage*) inAppMessage

The in-app message that is being displayed.

- (BOOL) inAppMessageIsTapped

The variable that shows if the in-app message has been clicked.

- (id<ABKInAppMessageUIDelegate>) inAppMessageUIDelegate

The optional ABKInAppMessageUIDelegate that can be used to customize display and behavior of the in-app message.

- (ABKInAppMessageViewController*) inAppMessageViewController

The view controller used to display the in-app message.

- (IBOutlet ABKInAppMessageWindow*) inAppMessageWindow

The UI window used to display the in-app message.

- (BOOL) isInRotation

The variable that shows if the device is being rotated.

- (UIInterfaceOrientation) preferredOrientation

The preferred orientation for in-app message display. The default is unknown, which means the orientation would be set as Status Bar current orientation.

- (NSTimer*) slideAwayTimer

The timer used to know when to slide the in-app message off the screen.

- (CGFloat) slideupConstraintMaxValue

Properties used to properly place the slideup in-app messages with pan gestures.

- (UIInterfaceOrientationMask) supportedOrientationMask

The orientation mask that the in-app message supports. The default value is UIInterfaceOrientationMaskAll