Configure In-App Messaging

You can enable and configure in-app messages within your application for both iOS and Android.

To enable in-app messaging, follow these steps:

  1. Enable in-app messaging by setting the enable_in_app_messaging parameter to true in your hydra-config.json file.
  2. Configure in-app messaging for iOS
    1. Add an Image Set named inAppPlaceholder in your project's Assets.xcassets. This image will serve as a placeholder when an in-app message does not include an image.
    2. In your AppDelegate.swift file, add the following at the top:
      import capillary_hydra_ios
      
    3. Add the following function to your AppDelegate.swift file:
      override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void){
          HydraNativeAPI.shared.application(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: completionHandler)
      }
      
  3. Configure in-app messaging for Android
    1. Add an image file named hydra_in_app_placeholder to the android/app/src/main/res/drawable folder. This image will be used as a placeholder when an in-app message does not include an image. The image file can be in PNG, JPG, or XML format.

Configuring the Inbox API

This API allows you to retrieve and display a list of messages for a user.

To set up the Inbox API, enable the Inbox API by setting the enable_inbox_api parameter to true in your hydra-config.json file.

📘

Note

To use the Inbox API in iOS, you must have added the notification service extension by following the instructions under Configuring rich notifications for iOS.

Configuring the Inbox UI

This allows you to use the native notification center UI included in Hydra SDK.

To enable the Inbox UI, follow these steps:

  1. Enable the Inbox API by following the instructions under Configuring the Inbox API.
  2. Enable the Inbox UI by setting the enable_inbox_ui parameter to true in your hydra-config.json file.
  3. Configure Inbox UI for iOS by adding an image asset named inboxUIPlaceholder in your project's Assets.xcassets.
  4. Configure Inbox UI for Android by adding an image file named hydra_inbox_ui_placeholder to the android/app/src/main/res/drawable folder.