AppboyKit (also known as the Objective-C SDK) is no longer supported and has been replaced by the Swift SDK. It will no longer receive new features, bug fixes, security updates, or technical support—however, messaging and analytics will continue to function as normal. To learn more, see Introducing the New Braze Swift SDK.
Custom Styling
Overriding default images
Integration of SDWebImage
is required if you plan on using our Braze UI for displaying images within iOS in-app messages 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 to override the default image in our library. Also, be sure to upload the @2x
and @3x
versions of the images to accommodate different phone sizes. Images available for override in Content Cards include:
- Placeholder image:
appboy_cc_noimage_lrg
- Pinned icon image:
appboy_cc_icon_pinned
Because Content Cards have a maximum size of 2 KB for content you enter in the dashboard (including message text, image URLs, links, and all key-value pairs), check the size before sending. Exceeding this amount will prevent the card from sending.
Overriding default images is currently not supported in our Xamarin iOS integration.
Disabling Dark Mode
To prevent the Content Card UI from adopting dark theme styling when the user device has Dark Mode enabled, set the ABKContentCardsTableViewController.enableDarkTheme
property. You can access the enableDarkTheme
property directly on an ABKContentCardsTableViewController
instance or via the ABKContentCardsViewController.contentCardsViewController
property to best suit your own UI.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Accessing enableDarkTheme via ABKContentCardsViewController.contentCardsViewController.
- (IBAction)presentModalContentCards:(id)sender {
ABKContentCardsViewController *contentCardsVC = [ABKContentCardsViewController new];
contentCardsVC.contentCardsViewController.enableDarkTheme = NO;
...
[self.navigationController presentViewController:contentCardsVC animated:YES completion:nil];
}
// Accessing enableDarkTheme directly.
- (IBAction)presentNavigationContentCards:(id)sender {
ABKContentCardsTableViewController *contentCardsTableVC = [[ABKContentCardsTableViewController alloc] init];
contentCardsTableVC.enableDarkTheme = NO;
...
[self.navigationController pushViewController:contentCardsTableVC animated:YES];
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Accessing enableDarkTheme via ABKContentCardsViewController.contentCardsViewController.
@IBAction func presentModalContentCards(_ sender: Any) {
let contentCardsVC = ABKContentCardsViewController()
contentCardsVC.contentCardsViewController.enableDarkTheme = false
...
self.navigationController?.present(contentCardsVC, animated: true, completion: nil)
}
// Accessing enableDarkTheme directly.
@IBAction func presentNavigationContentCards(_ sender: Any) {
let contentCardsTableVC = ABKContentCardsTableViewController()
contentCardsTableVC.enableDarkTheme = false
...
self.navigationController?.present(contentCardsTableVC, animated: true, completion: nil)
}