Integrating the iOS SDK

AS
Last updated 3 months ago

Adding the YocoSDK-UI Pod

The SDK is distributed using Cocoapods. You can see their Getting Started guide.

You need to make three adjustments to your Podfile.

  1. Set use_frameworks!

  2. Add the custom Podspec repositories using source

  3. Add the YocoSDK-UI dependency to your target

use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
source 'https://bitbucket.org/mpymnt/io.mpymnt.repo.pods.git'
source 'https://gitlab.com/yoco-public/yoco-podspec'
target 'YourProject' do
pod 'YocoSDK-UI'
end

Project Configuration

You need to add the following to your Info.plist

Name

Value

Supported external accessory protocols

com.miura.shuttle

Required background modes

App communicates with an accessory

App downloads content from the network

Privacy - Location When In Use Usage Description

Your location is used to ensure the security of your Yoco payments

Disable Bitcode

In the Build Settings for your project, you must set Enable Bitcode to No

Supporting offline payments

Offline payments allow your merchants to perform transactions even if there is a problem with one of our banking partners. When an offline transaction is performed, it will be stored on the phone or tablet and will be submitted to the Yoco platform at a later time.

If a merchant has performed an offline payment, we check periodically to see if we can/should submit these payments to our servers. In your Info.plist please add App downloads content from the network to Required Background Modes

Required background modes

Unfortunately there is no way for us to directly hook into the performFetchWithCompletionHandler notification for your application. In your app delegate please add the following code:

-(void) application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
completionHandler([YocoClient handleBackgroundFetch]);
}

It is highly recommended that you add this functionality to your application or else your merchants will not be able to process payments should any downtime occur on the Yoco platform.

Importing the SDK

You can now import the SDK and start using it!

@import YocoSDK_UI;

See Authentication for your next step.

If you have any questions, do not hesitate to contact us.