Display in-app messages in a custom view controller
In-app messages can also be displayed within a custom view controller, which you pass to Braze. Braze will animate the customized in-app message in and out and handle analytics of the in-app message. The view controller must meet the following requirements:
- It must be a subclass or an instance of
- The view of the returned view controller should be an instance of
ABKInAppMessageViewor its subclass.
The following UI delegate method is called every time an in-app message is offered to
ABKInAppMessageViewController to allow the app would like to pass a custom view controller to Braze for in-app message display:
1 - (ABKInAppMessageViewController *)inAppMessageViewControllerWithInAppMessage:(ABKInAppMessage *)inAppMessage;
1 func inAppMessageViewControllerWithInAppMessage(inAppMessage: ABKInAppMessage!) -> ABKInAppMessageViewController!
Our in-app message view controllers are open-source. You can use subclasses or categories to customize the display or behavior of in-app messages.
For additional information, see the following header files:
CustomInAppMessageViewController.m in the in-app message sample app.