Customize dismiss buttons on iOS

By default, there is a dismiss button on the top-left of the in-app message dialog. If you want to use your own image as this button, you can set it by making a call to setDismissButtonImageWithName or setDismissButtonImageWithImage.

This method creates a UIImage copy based on the maximum allowed image size, so the user doesn't have to keep the image after the call. The maximum allowed size for this image is 40x40 dp. If the user's image is larger on either side, it's automatically downscaled to the allowed size, keeping the same aspect ratio.

  1. Choose whether you will set the image by name or by image.
    • To set the image by name, use [Localytics setInAppDismissButtonImageWithName:imageName];
    • To se the image by image, use UIImage *dismissButtonImage = [UIImage imageNamed:imageName]; [Localytics setInAppDismissButtonImageWithImage:dismissButtonImage];
  2. If you want to clear the image and switch back to the default, pass a nil to this method as below.
    [Localytics setDismissButtonImageWithImage:nil];