Manual Integration in Objective-C

Prev Next

Goal

Manually integrate the Mapp Engage 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:

  1. Xcode with:

    • A base SDK of iOS 12 or above

    • A deployment target of iOS 12 or above

  2. A Mapp Engage Account with the mobile channel activated.

  3. Required permissions configured in your app's Info.plist.

Procedure

  1. Download the SDK.

  2. Add the SDK to Your Project

    • Drag AppoxeeSDK.xcframework into your project.

  3. Import the SDK in AppDelegate

    • Open your AppDelegate.m file and add:

      #import <AppoxeeSDK/AppoxeeSDK.h>
    • Declare the delegate in @interface:

      @interface AppDelegate() <AppoxeeNotificationDelegate>
      @end
  4. 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.xxx with the SDK Key configured in your Mapp Engage Channel Configuration.

    • The with parameter is the SERVER enum. Customer-facing values are L3, EMC, EMC_US, and CROC. Your account manager will tell you which one to use.

    Note:

    The SERVER enum also defines TEST, TEST55, and TEST61 values. These are internal test environments and are not meant for production use.

  5. 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];
          completionHandler(UIBackgroundFetchResultNewData);
      }
  6. Custom Delegate (Optional): Handle custom push actions by implementing:

    #pragma mark - AppoxeeNotificationDelegate
    - (void)appoxee:(Appoxee *)appoxee handledRemoteNotification:(APXPushNotification *)pushNotification andIdentifer:(NSString *)actionIdentifier {
        // A push notification was received and processed.
    }

    Warning:

    The selector appoxee:handledRemoteNotification:andIdentifer: contains a typo (Identifer without the second i) in the public header. Use the selector exactly as shown — it matches the symbol exported by AppoxeeSDK.xcframework.

Troubleshooting

  1. Framework Not Found: Ensure the framework is linked correctly in the "Build Phases" tab of your Xcode project.

  2. Push Notifications Not Working: Double-check your APNs certificate and Mapp Engage Dashboard settings.

  3. Compile Errors: Confirm import paths and SDK version compatibility.