Goal
Manually integrate the Mapp Engage SDK into your iOS app using Swift.
Note:
This guide covers manual integration for advanced users who need greater customization.
For basic integration, see the Basic Automated Setup.
Prerequisites
Before beginning, ensure:
Xcode Requirements:
Base SDK: iOS 12 or higher.
Deployment Target: iOS 12 or higher.
Mapp Engage Account:
An account on the Mapp Engage dashboard with a configured application.
Procedure
Download the SDK
Add the SDK to Your Project: Drag AppoxeeSDK.xcframework into your project.
Import the SDK: Add the following to your Objective-C bridging header:
#import <AppoxeeSDK/AppoxeeSDK.h>Set Up Delegates: Declare the AppDelegate class with the following:
class AppDelegate: UIResponder, UIApplicationDelegate, AppoxeeNotificationDelegate { // Class implementation }Configure
didFinishLaunchingWithOptions: Add the initialization code in theapplication:didFinishLaunchingWithOptions:method:func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { Appoxee.shared()?.engage(withLaunchOptions: launchOptions, andDelegate: nil, andSDKID: "Your_SDK_ID", with: .L3) return true }The
withparameter is theSERVERenum. Customer-facing values areL3,EMC,EMC_US, andCROC. Your account manager will tell you which one to use.Note:
The
SERVERenum also definesTEST,TEST55, andTEST61values. These are internal test environments and are not meant for production use.Handle Notifications: Implement the following methods:
Register for Notifications:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Appoxee.shared()?.didRegisterForRemoteNotifications(withDeviceToken: deviceToken) }Receive Remote Notifications:
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { Appoxee.shared()?.receivedRemoteNotification(userInfo) completionHandler(.newData) }
Optional Push Features
Custom Push Notification Categories: Register categories before calling
engage(...)and pass them to the SDK usingsaveUserNotificationCategories(_:):func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { _, _ in } application.registerForRemoteNotifications() let viewAction = UNNotificationAction(identifier: "view_now", title: "View", options: .foreground) let skipAction = UNNotificationAction(identifier: "skip", title: "Skip", options: .foreground) let category = UNNotificationCategory(identifier: "CUSTOM_CATEGORY_NAME", actions: [viewAction, skipAction], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: "", options: .customDismissAction) UNUserNotificationCenter.current().setNotificationCategories([category]) Appoxee.shared()?.saveUserNotificationCategories([category]) Appoxee.shared()?.engage(withLaunchOptions: launchOptions, andDelegate: nil, andSDKID: "Your_SDK_ID", with: .L3) return true }
Appoxee Delegate (Optional): Handle custom push actions by implementing:
func appoxee(_ appoxee: Appoxee, handledRemoteNotification pushNotification: APXPushNotification, andIdentifer actionIdentifier: String) { // Handle the custom push action }Warning:
The selector
appoxee:handledRemoteNotification:andIdentifer:contains a typo (Identiferwithout the secondi) in the public header. Use the selector exactly as shown — it matches the symbol exported byAppoxeeSDK.xcframework.