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:
 

Properties

IBOutlet ABKInAppMessageWindowinAppMessageWindow
 
NSTimer * slideAwayTimer
 
ABKInAppMessageinAppMessage
 
id< ABKInAppMessageUIDelegateinAppMessageUIDelegate
 
ABKInAppMessageViewControllerinAppMessageViewController
 
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
readwriteatomic

The ID of a button that has been clicked.

- (NSString*) clickedHTMLButtonId
readwriteatomicassign

The ID of an HTML button that has been clicked.

- (ABKInAppMessage*) inAppMessage
readwriteatomic

The in-app message that is being displayed.

- (BOOL) inAppMessageIsTapped
readwriteatomic

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

- (id<ABKInAppMessageUIDelegate>) inAppMessageUIDelegate
readwriteatomicweak

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

- (ABKInAppMessageViewController*) inAppMessageViewController
readwriteatomic

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

- (IBOutlet ABKInAppMessageWindow*) inAppMessageWindow
readwritenonatomicassign

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

- (BOOL) isInRotation
readwriteatomic

The variable that shows if the device is being rotated.

- (UIInterfaceOrientation) preferredOrientation
readwriteatomic

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
readwriteatomicassign

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

- (CGFloat) slideupConstraintMaxValue
readwriteatomic

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

- (UIInterfaceOrientationMask) supportedOrientationMask
readwriteatomic

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