Skip to main content
SDK Version

Customizations

By default, the Actito SDK automatically handles most of the complexity around iOS remote notifications.

However, you may want finer control over how these mechanisms integrate with your existing app architecture. This page explains the advanced configuration options available for remote notifications, how to disable specific SDK behaviors, and how to provide your own custom implementations.

tip

💡 All the configurations described on this page can be defined in your app’s ActitoOptions.plist file. See the Customizations guide for details on how this file works.

Disable method swizzling​

By default, the SDK performs method swizzling to automatically handle APNS delegate methods in your AppDelegate. This simplifies setup by intercepting system callbacks (such as didRegisterForRemoteNotificationsWithDeviceToken).

If you prefer to handle these callbacks manually you can disable this behavior by setting the following key in your ActitoOptions.plist:

<key>SWIZZLING_ENABLED</key>
<false/>

Once swizzling is disabled, you must forward the corresponding delegate methods to Actito manually:

class AppDelegate: NSObject, UIApplicationDelegate {
// ...

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
Actito.shared.push().application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
}

func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
Actito.shared.push().application(application, didFailToRegisterForRemoteNotificationsWithError: error)
}

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Actito.shared.push().application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
}
}

Disable UNUserNotificationCenter delegate​

Our library also assigns itself as the delegate for the UNUserNotificationCenter to automatically handle presentation and action events for incoming notifications.

If you already have your own implementation of UNUserNotificationCenterDelegate or prefer to handle these events manually, you can disable the SDK’s delegate assignment by setting the following key in ActitoOptions.plist:

<key>USER_NOTIFICATION_CENTER_DELEGATE_ENABLED</key>
<false/>

Once disabled, you’ll need to manually forward delegate calls to the SDK as shown below:

extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
// More code ...

// Pass the event to Actito.
Actito.shared.push().userNotificationCenter(center, didReceive: response, withCompletionHandler: completionHandler)
}

func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
// More code ...

// Pass the event to Actito.
Actito.shared.push().userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler)
}

func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) {
// More code ...

// Pass the event to Actito.
Actito.shared.push().userNotificationCenter(center, openSettingsFor: notification)
}
}

Preserving existing notification categories​

If your app already defines custom notification categories, and you want to keep them when Actito registers its own, you can preserve those existing categories by setting the following key in your ActitoOptions.plist:

<key>PRESERVE_EXISTING_NOTIFICATION_CATEGORIES</key>
<true/>

By default, Actito replaces existing notification categories when reloading its own. Enabling this option ensures that your app’s previously registered categories and actions remain available.

Disable Image Sharing​

When presenting an Image Gallery notification, Actito allows users to share the displayed images by default. If you want to prevent this behavior, you can disable it by adding the following key to your ActitoOptions.plist:

<key>IMAGE_SHARING_ENABLED</key>
<false/>

Custom close query parameter​

When presenting Webpage or HTML markup notifications, you can include links with query parameters to trigger in-app actions.

By default, the SDK looks for the notificareCloseWindow query parameter to dismiss the notification. If you’d like to use a different parameter name, you can customize it by adding the following key to your ActitoOptions.plist:

<key>CLOSE_WINDOW_QUERY_PARAMETER</key>
<string>customCloseParam</string>

Safari dismiss button style​

When presenting an In-App Browser notification, you can customize the Safari dismiss button that appears in the top right corner. To do so, set the following key in your ActitoOptions.plist:

<key>SAFARI_DISMISS_BUTTON_STYLE</key>
<integer>0</integer>

You can select between three types:

  • Done: By setting the value 0
  • Close: By setting the value 1
  • Cancel: By setting the value 2

Notifications Theming​

You can customize the visual appearance of your notifications using the THEMES key in your ActitoOptions.plist. This allows you to define Light and Dark themes, so your notification interfaces remain consistent with your app’s overall style.

Each theme accepts a set of color keys that affect different interface elements, such as backgrounds, buttons, toolbars, and text fields.

<key>THEMES</key>
<dict>
<key>LIGHT</key>
<dict>
<key>BACKGROUND_COLOR</key>
<string>#000000</string>
<key>ACTION_BUTTON_TEXT_COLOR</key>
<string>#000000</string>
<key>TOOLBAR_BACKGROUND_COLOR</key>
<string>#000000</string>
<key>ACTIVITY_INDICATOR_COLOR</key>
<string>#000000</string>
<key>BUTTON_TEXT_COLOR</key>
<string>#000000</string>
<key>TEXT_FIELD_TEXT_COLOR</key>
<string>#000000</string>
<key>TEXT_FIELD_BACKGROUND_COLOR</key>
<string>#000000</string>
<key>SAFARI_BAR_TINT_COLOR</key>
<string>#000000</string>
<key>SAFARI_CONTROLS_TINT_COLOR</key>
<string>#000000</string>
</dict>
<key>DARK</key>
<dict>
<key>BACKGROUND_COLOR</key>
<string>#FFFFFF</string>
<key>ACTION_BUTTON_TEXT_COLOR</key>
<string>#FFFFFF</string>
<key>TOOLBAR_BACKGROUND_COLOR</key>
<string>#FFFFFF</string>
<key>ACTIVITY_INDICATOR_COLOR</key>
<string>#FFFFFF</string>
<key>BUTTON_TEXT_COLOR</key>
<string>#FFFFFF</string>
<key>TEXT_FIELD_TEXT_COLOR</key>
<string>#FFFFFF</string>
<key>TEXT_FIELD_BACKGROUND_COLOR</key>
<string>#FFFFFF</string>
<key>SAFARI_BAR_TINT_COLOR</key>
<string>#FFFFFF</string>
<key>SAFARI_CONTROLS_TINT_COLOR</key>
<string>#FFFFFF</string>
</dict>
</dict>

Available keys​

  • BACKGROUND_COLOR: The main background color for the notification view.
  • ACTION_BUTTON_TEXT_COLOR: The text color of action buttons displayed in notifications.
  • TOOLBAR_BACKGROUND_COLOR: The color of any toolbar used within notification views.
  • ACTIVITY_INDICATOR_COLOR: The tint color of loading indicators.
  • BUTTON_TEXT_COLOR: The general text color of buttons used in interactive notifications.
  • TEXT_FIELD_TEXT_COLOR: The color of text inside text input fields.
  • TEXT_FIELD_BACKGROUND_COLOR: The background color of text fields.
  • SAFARI_BAR_TINT_COLOR: The background tint color of the Safari view controller used for in-app browser notifications.
  • SAFARI_CONTROLS_TINT_COLOR: The tint color for controls (e.g., buttons) within the Safari view controller.

Using a Strings Dictionary for Rich Push templates​

For Rich Push Templates, iOS allows you to define localized placeholder text for Hidden Previews (when users choose to hide notification content on the lock screen). To support this, you can include a Localizable.stringsdict file in your project, defining how those preview texts appear.

Strings Dictionary

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MY_RICH_PUSH_TEMPLATE_TITLE</key>
<dict>
<key>NSStringLocalizedFormatKey</key>
<string>%#@question@</string>
<key>question</key>
<dict>
<key>NSStringFormatSpecTypeKey</key>
<string>NSStringPluralRuleType</string>
<key>NSStringFormatValueTypeKey</key>
<string>u</string>
<key>zero</key>
<string></string>
<key>one</key>
<string>%u message awaits your answer</string>
<key>two</key>
<string></string>
<key>few</key>
<string></string>
<key>many</key>
<string></string>
<key>other</key>
<string>%u messages awaits your answer</string>
</dict>
</dict>
</dict>
</plist>

If your app supports several languages, repeat the operation for every localization file. This will allow you to customize how your notifications show in the lock screen when Hidden Previews are enabled.

Localizable texts​

Our library ships with support for multiple languages that can be customized. To do so, you just have to include the translation keys in your Localizable.xcstrings or <locale>.lproj/Localizable.strings file and provide the desired texts.

You can find all the available translation keys here.