Migrating to the iOS libraries version 2.2.2 or later

If your apps are instrumented with a version of the iOS libraries that are earlier than version 2.2.2, then you must migrate to the latest version.

Before you begin

Download the latest SDK for iOS and extract the contents.
Restriction: If you are migrating to MobileFirst Quality Assurance SDK version 3.2.0, or later, you must build your project using Xcode version 7.0, or later.

Procedure

  1. Remove the previous version of the SDK.
    1. Start Xcode.
    2. In the Xcode Project Navigator, click the Frameworks group.
    3. Locate the Q4M-Pre-Production.framework or Q4M-Production.framework file.
    4. Clean and rebuild the build folder of the project in Xcode. (Click Product > Clean, and then click Build.)
    5. Select the file and delete it by pressing the backspace key or by using the menu. When prompted with the message Do you want to move the file filename to the Trash, or only remove the reference to it?, click Move to Trash.
    Xcode removes all references to the SDK from the project settings.
  2. Add the new SDK to the project. Add the Q4M.framework folder to your project by dragging the folder to the Frameworks group in the Xcode Project Navigator.
  3. Ensure that all required libraries are included in your Xcode project.
    1. In the Xcode Project Navigator, click your project and then click Build Phases.
    2. Click Link Binary With Libraries.
    3. Under Link Binary With Libraries, ensure that you have the following frameworks:
      • AssetsLibrary.framework
      • AudioToolbox.framework
      • AVFoundation.framework
      • CoreData.framework
      • CoreLocation.framework
      • CoreMedia.framework
      • CoreMotion.framework
      • CoreTelephony.framework
      • CoreText.framework
      • CoreVideo.framework
      • MediaPlayer.framework
      • QuartzCore.framework
      • Security.framework
      • SystemConfiguration.framework
      To add a framework, click +.
  4. Update the header import statement. Replace any of the following import statements with #import <Q4M/MQALogger.h>:
    • #import <Q4M-Pre-Production/MQALogger.h>
    • #import <Q4M-Pre-Production/APHLogger.h>
    • #import <Q4M-Production/MQALogger.h>
    • #import <Q4M-Production/APHLogger.h>
    Tip: To search in Xcode, press Cmd+Shift+F.
  5. Set either production or preproduction mode. As of the version 2.2.2 SDK, there are no longer separate iOS SDK files for preproduction and production. Instead, you must set either the preproduction or production mode in your code that starts the MobileFirst Quality Assurance session. For information about the differences between preproduction and production mode, see Differences between preproduction and production modes.
    • To set the mode in Objective-C:
      1. Locate the didFinishLaunchingWithOptions method.
      2. Depending on your test phase, add one these lines of code inside the didFinishLaunchingWithOptions method:
        • To use preproduction mode, add the following line of code: [[MQALogger settings] setMode:MQAModeMarket];
        • To use production mode, add the following line of code: [[MQALogger settings] setMode:MQAModeQA];
      Tip: You can use build settings to compile your code to use one mode or the other. For instructions, see Installing the iOS libraries.
    • To set the mode in Swift:
      1. In the AppDelegate.swift file, search for the didFinishLaunchingWithOptions method.
      2. Depending on your test phase, add one of these lines of code inside the didFinishLaunchingWithOptions method:
        • To use preproduction mode, add the following line of code: MQALogger.settings().mode = MQAMode.QA
        • To use production mode, add the following line of code: MQALogger.settings().mode = MQAMode.Market
      Tip: You can use #if statements and a preprocessor macro to switch between modes. For instructions, see Installing the iOS libraries.

What to do next

Optionally, upgrade any deprecated MobileFirst Quality Assurance APIs. For information on deprecated API, see API changes between releases.