In-App SDK Integration Guide
    • 1 Minute to read
    • Dark
      Light

    In-App SDK Integration Guide

    • Dark
      Light

    Article summary

    Overview

    This guide explains the step-by-step process for integrating the In-App Messaging SDK with your iOS native application. Before proceeding with the In-App Messaging SDK, ensure that you have completed the initial iOS SDK integration and tested push notifications.

    Prerequisites

    • iOS SDK version v5.0+.

    • Access to the following information from Mapp Cloud:

      • cepURL: Jamie URL for caching and delivering in-app messages.

      • sdkKey: Unique SDK Key for your app.

      • appID: App ID from Mapp Engage Channel Management.

      • tenantID: Mapp Engage system ID.

    • Xcode environment for iOS app development.

    Procedure

    • Configure iOS SDK for In-App Cache Service:

      • Update AppoxeeConfig.plist: Add the following keys to your AppoxeeConfig.plist file:

        <key>inapp</key>
            <dict>
                <key>media_timeout</key>
                <integer>5</integer>
            </dict>

        Your Mapp Cloud account manager will provide the necessary values.

        Example:

    • Add Mapp Engage Mobile iOS SDK to Xcode:

      • Copy the AppoxeeInapp.framework and AppoxeeInappResources.bundle files into your project directory.

      • Add these files to your Xcode project: Navigate to Build Phases > Link Binary With Libraries and include the framework and bundle files.

    • Initialize the SDK:

      • Objective-C Implementation: Add the following code to the application:didFinishLaunchingWithOptions: method:

        - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
            [[AppoxeeInapp shared] engageWithDelegate:nil with:eMC];
            return YES;
        }
      • Swift Implementation: Add the following code to the application:didFinishLaunchingWithOptions: method:

        func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
            AppoxeeInapp.shared()?.engageWithDelegate(nil, with: .eMC)
            return true
        }

        The with parameter represents the server environment (l3, eMC, cROC, or tEST).

    • Trigger Custom Events: Custom trigger events allow you to define specific in-app behaviors, such as "Open App" or "Open Shopping Cart."

    Code Implementation

    Objective-C

    #import <AppoxeeInapp/AppoxeeInapp.h>
    
    // Trigger event
    [[AppoxeeInapp shared] reportInteractionEventWithName:@"Event_Name" andAttributes:@{@"key": @"value"}];

    Swift

    import AppoxeeInapp
    
    // Trigger event
    AppoxeeInapp.shared()?.reportInteractionEvent(withName: "Event_Name", andAttributes: ["key": "value"])

    Register Custom Events

    Use the registerAppEvents API in Mapp Cloud to register custom events.

    In-App Message Types

    The SDK supports three types of in-app messages:

    1. Full-Screen Message

    • Covers the entire screen.

    • Dismissal Option: 'X' icon at the top-right corner.

    2. Modal Message

    • Displayed in a popup.

    • Supports only portrait orientation.

    • Dismissal Option: 'X' icon at the top-right corner.

    3. Banner Message

    • Displays at the top or bottom of the screen.

    • Supports only portrait orientation.

    • Dismissal Option: 'X' icon at the top-right corner.

    Keep in mind:

    • The media_timeout in AppoxeeConfig.plist specifies the default timeout for in-app messages if no timeout is set.

    • Work closely with your Mapp Cloud account manager for any issues or further customization.


    Was this article helpful?