Content Cards View Controller Integration
Content Cards can be integrated with two view controller contexts: Navigation or Modal.
Example of pushing a
ABKContentCardsTableViewController instance into a navigation controller:
1 2 3 4 ABKContentCardsTableViewController *contentCards = [ABKContentCardsTableViewController getNavigationFeedViewController]; contentCards.title = "Content Cards Title"; contentCards.disableUnreadIndicator = YES; [self.navigationController pushViewController:contentCards animated:YES];
1 2 3 4 let contentCards = ABKContentCardsTableViewController() contentCards.title = "Content Cards Title" contentCards.disableUnreadIndicator = true navigationController?.pushViewController(contentCards, animated: true)
To customize the navigation bar’s title, set the title property of the
This modal is used to present the view controller in a modal view, with a navigation bar on top and a Done button on the right side of the bar.
1 2 3 4 ABKContentCardsViewController *contentCards = [[ABKContentCardsViewController alloc] init]; contentCards.contentCardsViewController.title = "Content Cards Title"; contentCards.contentCardsViewController.disableUnreadIndicator = YES; [self.navigationController presentViewController:contentCards animated:YES completion:nil];
1 2 3 4 let contentCards = ABKContentCardsViewController() contentCards.contentCardsViewController.title = "Content Cards Title" contentCards.contentCardsViewController.disableUnreadIndicator = true self.present(contentCards, animated: true, completion: nil)
For examples of these view controllers, check out our Content Cards sample app.
To customize the header, set the title property of the
navigationItem belonging to the
ABKContentCardsTableViewController instance embedded in the parent
Overriding Default Images
Note that integration of
SDWebImage is required if you plan on using our Braze UI for displaying images within iOS In-App Messages, News Feed, or Content Cards.
Braze allows clients to replace existing default images with their own custom images. To accomplish this, create a new
png file with the custom image and add it to the app’s image bundle. Then, rename the file with the image’s name (see below) to override the default image in our library. Images available for override in Content Cards include:
- Placeholder image:
- Pinned icon image:
Because Content Cards have a maximum size of 2kb (including images, links, and all content) make sure to check the size before sending. Exceeding this amount will prevent the card from sending.
Be sure to upload the
@3x versions of the images as well to accommodate different phone sizes.
Note that overriding default images is currently not supported in our Xamarin iOS integration.
Customizing the Content Cards Feed
You can create your own Content Cards interface by extending
ABKContentCardsTableViewController to customize all UI elements and Content Cards behavior. Alternatively, you can create a completely custom view controller and subscribe for data updates. In the latter case, you would need to log all view events, dismissed events, and clicks manually.