Upgrading to 2.1.0

The 2.1.x range of the Yoco SDK changed to using Cocoapods for installation. While there are quite a large number of changes under the hood, the public interfaces are all backwards compatible with earlier versions.

Project setup

1. Remove old files

You should remove the old files from your project and delete them.

  • YocoSDK.framework

  • YocoSDK.bundle

  • Any framework/bundle starting with mpos

  • Intercom.framework

  • Intercom.bundle

2. Add YocoSDK-UI to your Podfile

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

3. Switch to using the YocoSDK_UI module

We now provide the SDK through a module so you should import this instead of including headers.

@import YocoSDK_UI;

Supporting offline payments

If a merchant performs an offline payment, we check periodically to see if we can 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]);
}

We also prompt the user to open the app if they have unsubmitted payments using local notifications (this is why we require UserNotifications.framework). You do not need to have remote-notifications in your plist for this to work.

See Integrating the iOS SDK for more detailed instructions.