Implement the Containment library into your application

To implement the Containment library into your application, perform the following steps:

  1. Add CTXMAMContainment.framework to your project on the project target properties, under the General tab if you haven’t already added it.

    Note:

    Add the CTXMAMCore.framework and CTXMAMAppCore.framework if you have not added them already. See Integrate MAM SDK to confirm that you have already added the frameworks. If you are not using the framework, ensure that you remove it.

    If you are running Xcode 11 or later, add the frameworks in the Frameworks, Libraries, and Embedded Content section. Now select Embed & Sign option from the Embed drop-down list.

    If you are running any other version of Xcode, add the frameworks to the Embedded Binaries section.

    Add frameworks

  2. Add Imports
    1. For Objective-C, add CTXMAMCore/CTXMAMCore.h and CTXMAMContainment/CTXMAMContainment.h into your AppDelegate.m file.

      #import <CTXMAMCore/CTXMAMCore.h>
      #import <CTXMAMContainment/CTXMAMContainment.h>
      <!--NeedCopy-->
      
    2. For Swift, add CTXMAMCore and CTXMAMContainment into your AppDelegate.swift

       import CTXMAMCore
       import CTXMAMContainment
       <!--NeedCopy-->
      
  3. If you want to subscribe to notifications to receive any notification from the Containment library, the source is MdxNotificationSource_Containment.
    1. Objective-C

       [[CTXMAMNotificationCenter mainNotificationCenter] registerForNotificationsFromSource:CTXMAMNotificationSource_Containment
                                                           usingNotificationBlock:notificationHandler];
       <!--NeedCopy-->
      
    2. Swift

       CTXMAMNotificationCenter.main()?.registerForNotifications(fromSource: CTXMAMNotificationSource_Containment
                                                                   , usingNotificationBlock: notificationHandler)
       <!--NeedCopy-->
      
Implement the Containment library into your application

In this article