Goal
Manually integrate the Mapp SDK into your iOS app using Objective-C.
Note:
This guide covers manual integration for advanced users who need greater customization.
For basic integration, see the Basic Automated Setup.
Prerequisites
Before starting, ensure you have:
Xcode with:
A base SDK of iOS 11 or above
A deployment target of iOS 11 or above
A Mapp Engage Account with the mobile channel activated.
Ensure all required permissions are configured in your app's
Info.plist.
Procedure
Download the SDK.
Add the SDK to Your Project
Drag the
AppoxeeSDK.frameworkorAppoxeeSDK.xcframeworkinto your project.
Import the SDK in AppDelegate
Open your
AppDelegate.mfile and add:#import <AppoxeeSDK/AppoxeeSDK.h>If you're using the
.xcframeworkversion, the import statement should look like:#import "AppoxeeSDK.h"Declare the delegate in
@interface:@interface AppDelegate() <AppoxeeNotificationDelegate> @end
Initialize the SDK: Add the following to the
application:didFinishLaunchingWithOptions:method:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[Appoxee shared] engageWithLaunchOptions:launchOptions andDelegate:self andSDKID:@"xxx.xxx" with: L3]; // Insert other initialization code or other Frameworks code here. return YES; }Replace
xxx.xxxwith the SDK Key configured in your Mapp Engage Channel Configuration.The parameter
withrepresents enum SERVER that enables you to choose one of the four options:L3,EMC,L3_US,EMC_US.The account manager will provide you with the info on which one you should use in your application.
Handle Notifications: Implement the following methods to handle push notifications:
Register Device Token:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [[Appoxee shared] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; }Receive Remote Notifications:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { [[Appoxee shared] receivedRemoteNotification:userInfo]; }Handle Push Actions (Optional for iOS 8+):
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler { BOOL didHandle = [[Appoxee shared] handleActionWithIdentifier:identifier forRemoteNotification:userInfo completionHandler:completionHandler]; if (!didHandle) { // Handle any remaining actions completionHandler(); } }
Additional Delegate Methods: To handle silent notifications or additional delegate calls, consider implementing:
Silent Notifications: Documentation for silent push notifications is provided with the SDK.
Custom Delegates:
#pragma mark - AppoxeeDelegate - (void)Appoxee:(Appoxee *)appoxee handledRemoteNotification:(APXPushNotification *)pushNotification andIdentifer:(NSString *)actionIdentifier { // A push notification was received and processed. }
Troubleshooting
Framework Not Found: Ensure the framework is linked correctly in the "Build Phases" tab of your Xcode project.
Push Notifications Not Working: Double-check your APNs certificate and Appoxee Dashboard settings.
Compile Errors: Confirm import paths and SDK version compatibility.