-
Notifications
You must be signed in to change notification settings - Fork 0
PubNative iOS SDK Integration
Can Soykarafakılı edited this page Mar 2, 2018
·
2 revisions
When you export your Unity Project into a Xcode project make sure to include this step below;
- Select your target and navigate to the Build Phases. Then, add a Run Script step to your build steps.

- Put it after your step to Embed Frameworks, set it to use
/bin/shand enter the following script:
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
find "$APP_PATH" -name 'Pubnative.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- Do not forget to check your project’s “Frameworks Search Paths” in your Build Settings. Make sure that the path for Pubnative.framework is provided correctly.
Important Note: PubNative iOS SDK supports iOS 8.0 and up. Full-featured SDK supports iOS 9.0 and up.
iOS Integration
Android Integration
Displaying ads in Unity