This topic introduces how to quickly set up Alipay+ MPP iOS SDK.
Before you begin
Before you get started, ensure that the following requirements are met:
- Install the following tools:
- Xcode 12.* or later
- Ensure that the minimum deployment target is set to iOS 9 or later.
Step 1. Add SDK to your project
- Contact your Alipay+ Solution Architect (SA) to obtain the Alipay+ SDK binaries as a package. You can also obtain the source code if you need to review or customize the SDK source code.
The following table lists the SDK packages that are required for different Alipay+ payment products:
Merchant-presented Mode Payment
- Ensure that the SDK is linked to your project.
- If you use CocoaPods to publish your SDK, add the following lines to your podspec file:
s.subspec 'Foundation' do |ss| ss.vendored_frameworks= ["YOUR_PATH/MPPAlipayPlusClient.framework", "YOUR_PATH/IAPTinyLogger"] end s.subspec 'MPM' do |ss| ss.vendored_frameworks= ["YOUR_PATH/MPPAlipayPlusClientMPM.framework", "YOUR_PATH/IAPMinContainer.framework"] ss.resources = ["YOUR_PATH/IAPMinContainer.framework/IAPMinContainer.bundle"] ss.dependency "YOUR_POD/Foundation" end s.subspec 'AutoDebit' do |ss| ss.vendored_frameworks= ["YOUR_PATH/MPPAlipayPlusClientAutoDebit.framework"] ss.dependency "YOUR_POD/Foundation" end
- If you do not use CocoaPods, you can manually add the SDK as follows:
- Add the required framework and bundle files to your project based on the product you use. Make sure to select Copy items if needed.
(1) Merchant-presented Mode Payment
(2) Auto Debit
- Make sure to add -ObjC to Build Settings > Linking > Other Linker Flags to use class category.
Note: If your project is created using swift and the "Undefined symbol: ___llvm_profile_runtime" error is triggered during build, try add -fprofile-instr-generate to Build Settings > Linking > Other Linker Flags to resolve the error.
Step 2. Set up the SDK before using other APIs
- Import the SDK header file to your project.
2. Set up the SDK with required configurations.
MPPConfiguration *configuration = IAPConfiguration.new; configuration.clientId = @"xxx"; [[MPPAlipayPlusClient shared] setConfiguration:configuration];
After you have integrated the SDK, you can move on to use the SDK in different payment scenarios.
For more information about how to use the SDK in Merchant-presented Mode Payment, see Merchant-presented Mode Payment integration.
For more information about how to use the SDK in Auto Debit, see Auto Debit integration.