To install the frameworks manually, follow the steps below:
Download the latest SDK from our GitHub repository.Refer to the link below to get the framework from Frameworks folder.
- Download MoEngage-iOS-SDK from MoEngage-iOS-SDK GitHub repository.
- Download MoEngageInApp from MoEngageInApp GitHub repository.
- Download MoEngageCards from MoEngageCards GitHub repository.
- Download MoEngageGeofence from MoEngageGeofence GitHub repository.
- Download MoEngageRichNotification from MoEngageRichNotification GitHub repository.
- Download MoEngageRealTimeTrigger from MoEngageRealTimeTrigger GitHub repository.
- Download MoEngageInbox from MoEngageInbox GitHub repository.
Copy Framework files into your project
Add the Framework file of the module you want to integrate into your project. Also, make sure that MoEngageSDK.framework
,MoEngageCore.framework
,MoEngageAnalytics.framework
,MoEngageObjcUtils.framework
and MoEngageMessaging.framework
]. This is because all the other modules have a dependency on these frameworks. Embedded Frameworks in App Target.
Link MoEngageRichNotification framework in App Extensions
This is only required if you are using the MoEnagageRichNotification
framework in the project. Make sure to link the framework in the Extension targets as shown below and set Embed option to Do Not Embed in this case as it is already embedded in your App Target:
Add the Run Script for removing unsupported architectures
Select App Target and go to Build Phase and add a Run Script step to your build steps, set it to use /bin/sh
and enter the script provided below. And it's a generic script for all the manually integrated frameworks for removing unsupported architectures(Simulator architectures) while exporting the build OR submitting the app to AppStore:
if [ "$CONFIGURATION" == "Debug" ]; then
echo "Skip frameworks cleaning in debug configuration"
exit 0
fi
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.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"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done