Installation
CocoaPods
To integrate the Visa Checkout iOS SDK into your Xcode project using CocoaPods, specify it in your Podfile
:
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
# See https://github.com/CocoaPods/Specs/tree/master/Specs/7/7/b/VisaCheckoutSDK for a full list of versions
pod 'VisaCheckoutSDK', '6.2.0'
end
Then, run the following command:
$ pod install
Manual
Embed VisaCheckoutSDK.framework
Drag the VisaCheckoutSDK.framework file into the Embedded Binaries list in your project.
Be sure to select ✅ Copy items if needed and Create groups.
Deployment
The following is a necessary step due to a lack of functionality in Xcode. This script is required to run as a final script in your project’s Build Phases. This script will need to be run when archiving your app for the App Store.
For more information on what this does, click here.
- Go to your Build Phases tab for your target’s settings.
- Click on the + icon and select New Run Script Phase. Make sure the script is run after Embedded Frameworks.
- Select the ✅Run script only when installing option.
- Paste the following code into the script code window:
# This script removes simulator architectures from VisaCheckoutSDK.framework so it can be uploaded to the App Store.
# Make this a Build Phase run script after the 'Embed Frameworks' phase.
# 'Run script only when installing' should be checked.
# http://stackoverflow.com/questions/30547283/submit-to-app-store-issues/30866648
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
FRAMEWORK_EXECUTABLE_NAME=VisaCheckoutSDK
find "$APP_PATH" -name "${FRAMEWORK_EXECUTABLE_NAME}.framework" -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
done