In-app messaging

This page provides you with information on In-app messaging feature.

The In-app messaging targets users by displaying messages while they are using your app. These messages are highly effective in providing contextual information and facilitating cross-selling/up-selling on specific screens or actions within your app.

Prerequisites

  • HydraPushNotification framework: Manages in-app messages.
  • HydraInAppMessaging framework: Handles silent remote notifications (in-app messages).

Integration

Add the HydraInAppMessage framework. This framework is responsible for processing in-app messages.

Initialize InAppMessagingCore object

Initialize the InAppMessagingCore object and create an instance of the InboxCore using the following method:

public init(with config: HydraInAppMessageConfigGenerator, environment env: Env = .dev) throws
ParameterTypeMandatory/OptionalDescription
configHydraInAppMessageConfigGeneratorCompulsoryAn object of class conforming to HydraInAppMessageConfigGenerator protocol
envEnvironmentOptionalEither .dev or .unittest

HydraInAppMessageConfigGenerator
This value is required and can be generated using the following protocol:

public protocol HydraInAppMessageConfigGenerator {
    var hydraConfig: ConfigurationGenerator { get set }
    var notificationCore: NotificationCore? { get set }
    var placeholderImage: UIImage? { get set }
    var appStoreId: String? { get set }
}

ParameterTypeMandatory/OptionalDescription
hydraConfigConfigurationGeneratorCompulsoryAn instance of Hydra core.
notificationCoreNotificationCoreOptionalAn instance of Notification core.
placeholderImageUIImageOptionalAn object of UIImage class.
appStoreIdStringOptionalApplication's app store id.

Example:

let config = try HydraConfiguration(accountID: "AccountID", customerId: "CustomerID", server: .server1)
guard let hydra = try? Hydra.generate(with: config) else {
    Logger.error("Error in configuration generation")
    return nil
}
Logger.updateLogLevel(level: .critical)
do {
    let inAppConfig = HydraInAppMessageConfiguration(hydraConfig: config, notificationCore: notificationCore, appStoreId: "", placeholderImage: nil)
    inAppCore = try InAppMessagingCore(with: inAppConfig, environment: .dev)
} catch let error {
    print(error)
}

InApp-supported layouts

App rating

App rating

Feedback

Feedback

Footer

Footer

Header

Header

Interstitial

Interstitial

Pop up

Pop up

Rating

Rating