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

#import <ABKInAppMessageController.h>

Instance Methods

(void) - displayNextInAppMessageWithDelegate:
 
(void) - displayNextInAppMessage
 
(NSInteger) - inAppMessagesRemainingOnStack
 
(void) - addInAppMessage:
 

Properties

id
< ABKInAppMessageControllerDelegate
delegate
 
id< ABKInAppMessageUIControllinginAppMessageUIController
 
BOOL enableDismissModalOnOutsideTap
 

Detailed Description

Note: This class is not thread safe and all class methods should be called from the main thread.

Method Documentation

- (void) addInAppMessage: (ABKInAppMessage *)  newInAppMessage

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.

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.

Parameters
newInAppMessagethe in-app message to add.
- (void) displayNextInAppMessage

Displays the next in-app message from the in-app message stack.

This method pops the next in-app message from the in-app message stack and tries to displays it. When defined, the current delegate methods are executed to respect any custom behavior.

- (void) displayNextInAppMessageWithDelegate: ("Please use 'displayNextInAppMessage' instead.")  __deprecated_msg
Parameters
delegateThe in-app message delegate that implements the ABKInAppMessageControllerDelegate methods. If the delegate is nil, it acts as one which always returns ABKDisplayInAppMessageNow and doesn't implement all other delegate methods.

This method grabs the next in-app message from the in-app message stack, if there is one, and displays it with the provided delegate. The delegate must return a ABKInAppMessageDisplayChoice that defines how the in-app message will be handled. Please refer to the ABKInAppMessageDisplayChoice enum documentation for more detailed information.

If there are no in-app messages available this returns immediately having taken no action.

- (NSInteger) inAppMessagesRemainingOnStack
Returns
The number of in-app messages that are locally waiting to be displayed.

Use this method to check how many in-app messages are waiting to be displayed and call displayNextInAppMessageWithDelegate: at to display it. If an in-app message is currently being displayed, it will not be included in the count.

Note: Returning ABKDisplayInAppMessageLater in the beforeInAppMessageDisplayed: delegate method will put the in-app message back onto the stack and this will be reflected in inAppMessagesRemainingOnStack.

Property Documentation

- (id<ABKInAppMessageControllerDelegate>) delegate
readwritenonatomicweak

Setting the delegate allows your app to control how, when, and if in-app messages are displayed. Your app can set the delegate to override the default behavior of the ABKInAppMessageController. See ABKInAppMessageControllerDelegate.h for more information.

- (BOOL) enableDismissModalOnOutsideTap
readwriteatomic

This boolean determines if modal in-app messages will be dismissed when the user taps outside of the in-app message.

The default of this value is NO but can be overriden by setting the value of ABKEnableDismissModalOnOutsideTapKey in appboyOptions or in the Braze dictionary in your Info.plist file.

- (id<ABKInAppMessageUIControlling>) inAppMessageUIController
readwritenonatomicstrong

If you have implemented the In-App Message subspec, you can use the ABKInAppMessageUIController to control in-app message behavior. See ABKInAppMessageUIController for more information.