Setting Up mParticle in Your iOS Project

To integrate the mParticle Appboy SDK into your iOS application, ensure you follow these steps carefully to avoid common errors, such as the "No such module 'mParticle_Appboy'" issue.

Step 1: Create Your Podfile

Begin by creating or updating your Podfile. Below is an example configuration:

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'YourAppName' do
  # Enable dynamic frameworks
  use_frameworks!

  # Include the mParticle Appboy SDK
  pod 'mParticle-Appboy', '~> 8.0'

  target 'YourAppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'YourAppNameUITests' do
    # Pods for UI testing
  end
end

Make sure to replace YourAppName with the actual name of your project.

Step 2: Install the Pods

After updating your Podfile, run the following commands in your terminal:

pod install

This command will install the specified dependencies. If you encounter issues, you may want to try:

pod deintegrate
pod install

Step 3: Open the Workspace

Always open your project using the .xcworkspace file instead of the .xcodeproj file. This ensures that Xcode recognizes all installed pods.

Step 4: Clean the Build

If you still face the "No such module 'mParticle_Appboy'" error, try cleaning your build folder in Xcode:

  • Go to the menu bar and select Product > Clean Build Folder (or press Shift + Command + K).

Step 5: Import the SDK

In your Swift or Objective-C files, ensure you are importing the SDK correctly. For Swift, use:

import mParticle_Appboy

For Objective-C, use:

#import <mParticle_Appboy/mParticle_Appboy.h>

Troubleshooting

If you continue to experience issues:

  • Double-check your Podfile for typos.
  • Ensure that the SDK version is compatible with your project setup.
  • Clean the Derived Data in Xcode by navigating to Xcode > Preferences > Locations and clicking on the arrow next to the Derived Data path.

By following these steps, you should be able to successfully integrate the mParticle Appboy SDK into your iOS project without encountering the "No such module" error.