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:
(NSInteger) - inAppMessagesRemainingOnStack
(void) - addInAppMessage:


< ABKInAppMessageControllerDelegate
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
newInAppMessageA new in-app message that will be added into the top of the stack of in-app messages that haven't been displayed yet.

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.

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.

- (void) displayNextInAppMessageWithDelegate: (nullable id< ABKInAppMessageControllerDelegate >)  delegate
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
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

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

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 Appboy dictionary in your Info.plist file.

- (id<ABKInAppMessageUIControlling>) inAppMessageUIController

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.