mFilterIt iOS SDK

This guide details the steps to integrate the MFilterIt SDK into an iOS App. The MFilterit SDK is distributed as an iOS dynamic framework.

Getting Started

Integrating the mFilterIt Solution into an app includes Developer Registration and SDK integration.

Developer Registration

Developers wishing to use mFilterIt should first register themselves. Upon registration a unique vendor ID and SDK credentials are allocated.

The vendor ID remains the same for all platforms supported (Android , iOS, Cordova , Unity etc.)

If you do not have a vendor ID, please contact us at contact@mfilterit.com

SDK Integration

1. Integration using Framework

The SDK integration includes the followings : Step 1 : The SDK is made available as a zip archive. This archive needs to be extracted and included into "Embedded Binaries" of your App project as shown in the screenshot given below.

Step 2 : The SDK is initialized by adding an API call in appDelegate. This should be done in the "didFinishLaunchingWithOptions". SDK is invoked as shown below.

  MFAnalyticsConfiguration *configuration = [MFAnalyticsConfiguration         configurationWithWriteKey:@"YOUR VENDOR ID"];  configuration.flushAt = 1;      configuration.trackApplicationLifecycleEvents = YES;  [MFAnalytics setupWithConfiguration:configuration];

The below import statement should be added to the appDelegate.

#import <Mfilterit/Mfilterit.h>

2. Integration of framework using CocoaPods

Step 1 : **Add source to Podfile:

source 'https://github.com/mfilterit/MfilteritFramework-specs.git'

Step 2 : Add following pod to app target block in the Podfile:

pod 'MfilteritiOSframework','{version_number}'

Note : Current SDK version number is '4.0.1'

Step 3 : Run the below command by going to project directory

pod install

If prompted, please enter the crdentials as username and password, provided by us.

Step 4 : The SDK is initialized by adding an API call in appDelegate. This should be done in the "didFinishLaunchingWithOptions". SDK is invoked as shown below.

 MFAnalyticsConfiguration *configuration = [MFAnalyticsConfiguration         configurationWithWriteKey:@"YOUR VENDOR ID"];  configuration.flushAt = 1;      configuration.trackApplicationLifecycleEvents = YES;  [MFAnalytics setupWithConfiguration:configuration];

The below import statement should be added to the appDelegate.

#import <Mfilterit/Mfilterit.h>

Submitting to App Store

When you submit to the app store, be aware that the SDK collects the IDFA information . Even if you’re not currently doing mobile install attribution, if you get asked, “Does this app use the Advertising Identifier (IDFA)?” on this page, you’ll want to check the following three boxes:

  1. “Attribute this app installation to a previously served advertisement”

  2. “Attribute an action taken within this app to a previously served advertisement”

  3. “I, YOUR_NAME, confirm that this app, and any third party…”

Note, you should not check the box labeled “Serve advertisements within the app” unless you are actually going to display ads.

Removing simulator binary data when creating archive

A Run Script needs to be added to the Build Phases for the same, as shown below (please make sure that in build phases, order of run script should be at last):

Please use the below code as the run script

echo "Target architectures: $ARCHS"

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

find "$APP_PATH" -name 'Mfilterit.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

FRAMEWORK_TMP_PATH="$FRAMEWORK_EXECUTABLE_PATH-tmp"

# remove simulator's archs if location is not simulator's directory
case "${TARGET_BUILD_DIR}" in
*"iphonesimulator")
echo "No need to remove archs"
;;
*)
if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "i386") ; then
lipo -output "$FRAMEWORK_TMP_PATH" -remove "i386" "$FRAMEWORK_EXECUTABLE_PATH"
echo "i386 architecture removed"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
fi
if $(lipo "$FRAMEWORK_EXECUTABLE_PATH" -verify_arch "x86_64") ; then
lipo -output "$FRAMEWORK_TMP_PATH" -remove "x86_64" "$FRAMEWORK_EXECUTABLE_PATH"
echo "x86_64 architecture removed"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_TMP_PATH" "$FRAMEWORK_EXECUTABLE_PATH"
fi
;;
esac

echo "Completed for executable $FRAMEWORK_EXECUTABLE_PATH"
echo $(lipo -info "$FRAMEWORK_EXECUTABLE_PATH")

done

Last updated