Configure the iOS SDK prior to v2.16.0
Note: versions of MobbScan prior to v2.16.0 are no longer maintained. Therefore, we recommend integrating version v2.16.0 or later following these steps. If you do not have v2.16.0, please contact your Mobbeel representative and they will send it to you.
Integrating MobbScan iOS SDK versions older than v2.16.0 (eg: v2.15.18)
If you want to use MobbScan iOS SDK in a version prior to v2.16.0, you should follow these steps in order to integrate it to your project.
Integrating MobbScan iOS SDK
If you want to use MobbScan iOS SDK, you should follow these steps in order to integrate it to your project.
1) Add the frameworks, bundle and files included in the SDK distribution folder to your project.
You can just drag and drop the libs folder within the SDK to your project.
Note: Check the
Copy items if needed
option if libs folder are not in your project folder.
Note: Please note that if you add the whole libs folder all frameworks will be included. It is better if you add the basic frameworks and you add the rest once you need them. The basic frameworks you'll need, along with MobbScanSDK-iOS.bundle are:
Please remember to add MobbCommons.framework
to the Embedded Binaries
Note: There are optional features in the SDK that will require additional configuration. The section detailing each feature will explain what it needs to be configured in the Getting Started section.
2) Add the required frameworks and libraries to your target application on the Link Frameworks and Libraries section
The required frameworks and libraries are:
libc++.tbd
libiconv.dylib
AssetsLibrary.framework
AudioToolbox.framework
AVFoundation.framework
CoreMedia.framework
CoreMotion.framework
Once everything is configured you should have something like this:
-ObjC -lsqlite3
flags to “Other Linker Flags” in the Build Settings.
3) Add If you follow these steps you should be able to import the #import <MobbScanSDK-iOS/MobbScanSDK-iOS.h>
header in your files.
Troubleshooting
Framework cannot be found
Sometimes, when you add the framework to the project, the source folder of the framework itself is not correctly added to the project's configuration. Please make sure that the folder is added to the Framework Search Paths in the Build Settings of the project.
App Store distribution
Note: As of MobbScan v2.18.4 you can skip this step as it is no longer needed.
The libraries/frameworks included in the SDK distribution file contain the binaries for the supported simulators. Before distributing your app to the App Store, you must strip those simulator binaries from the frameworks.
To get this done create a new Run Script build phase for your app target to get rid of the simulator architectures included in the frameworks. Select the Build Phases
, click on the +
icon and select New Run Script Phase
in the drop down menu. Type this command in the shell box:
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
if [[ ( "$FRAMEWORK" == *"TwilioVideo"* ) || ( "$FRAMEWORK" == *"protobuf_lite_ios"* ) || ( "$FRAMEWORK" == *"MobbIDSDK_Core"* )|| ( "$FRAMEWORK" == *"MobbIDSDK_Face"* )]] ; then
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"
fi
done
Since this step is only needed for the Archive
process, you should check the option Run script only when installing
.
Note: This phase should be included after the embeded framework phase, so that the architectures strip can be done properly.
SDK Example
An example application is included in the SDK. You can find it under the sample
folder of the SDK.
The example app simply scans a Spanish identity document and then shows all the results on screen.