The in-app message UI delegate allows you to control the display and behavior of the Braze in-app message.
- (ABKInAppMessageDisplayChoice) beforeInAppMessageDisplayed: |
|
(ABKInAppMessage *) |
inAppMessage |
withKeyboardIsUp: |
|
(BOOL) |
__deprecated |
|
|
| |
|
optional |
- Parameters
-
inAppMessage | The in-app message object being offered to the delegate method. |
keyboardIsUp | This boolean indicates whether or not the keyboard is currently being displayed when this delegate fires. |
- Returns
- ABKInAppMessageDisplayChoice for details refer to the documentation regarding the ENUM ABKInAppMessageDisplayChoice above.
This delegate method defines whether the in-app message will be displayed now, displayed later, or discarded.
The default behavior is that the in-app message will be displayed unless the keyboard is currently active on the screen. However, if there are other situations where you would not want the in-app message to appear (such as during a full screen game or on a loading screen), you can use this delegate to delay or discard pending in-app message messages.
This method is deprecated. Please use the beforeInAppMessageDisplayed: method in ABKInAppMessageControllerDelegate and use the methods receiveKeyboardDidHideNotification: and receiveKeyboardWasShownNotification: in ABKInAppMessageUIController to customize based on keyboard behavior.
- Parameters
-
inAppMessage | The in-app message object being offered to the delegate. |
This delegate method allows host applications to customize the look of an in-app message while maintaining the same user experience and impression/click tracking as the default Braze in-app message. It allows developers to pass incoming in-app messages to custom view controllers which they have created.
The custom view controller is responsible for handling any responsive UI layout use-cases. e.g. device orientations, or varied message lengths.
Even with a custom view, by inheriting from ABKInAppMessageViewController, the in-app message will automatically animate and dismiss according to the parameters of the provided ABKInAppMessage object. See ABKInAppMessage.h for more information.
By default, Braze will add following functions/changes to the custom view controller, and animate the in-app message on and off the screen, based on the class of the given in-app message:
- ABKInAppMessageSlideup:
- stretch/shrink the in-app message view's width to fix the screen's width. If you wish to have margins between the in-app message and the edge of the screen, those must be incorporated into the custom view controller itself.
- add the impression and click tracking for the in-app message
- when user clicks on the in-app message, call the onInAppMessageClicked:, and handle the click behavior correspond to the in-app message's inAppMessageClickActionType property.
- add a pan gesture to the in-app message so user can swipe it away.
- ABKInAppMessageModal:
- make the in-app message clickable when there is no button(s) on it.
- put the in-app message in the center of the screen, and add a full screen background layer.
- ABKInAppMessageFull:
- 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.
- Returns
- An ABKInAppMessageViewController subclass for which the view is an ABKInAppMessageView instance or subclass. Returning nil will prevent the in-app message from displaying.