Skip to main content Link Search Menu Expand Document (external link)

Integration

Table of contents

Requirements

  • iOS 12.0+
  • Swift 5.3+
  • Xcode 12.0+

This is the recommended integration method.

dependencies: [
    .package(url: "https://github.com/afterpay/sdk-ios.git", .upToNextMajor(from: "5.2.0"))
]

Carthage

github "afterpay/sdk-ios" ~> 5.2

CocoaPods

pod 'Afterpay', '~> 5.2'

Manual

If you prefer not to use any of the supported dependency managers, you can choose to manually integrate the Afterpay SDK into your project.

Source

GitHub Release

Download the latest release source zip from GitHub and unzip into an Afterpay directory in the root of your working directory.

Git Submodule

Add the Afterpay SDK as a git submodule by navigating to the root of your working directory and running the following commands:

git submodule add https://github.com/afterpay/sdk-ios.git Afterpay
cd Afterpay
git checkout 5.2.0

Project / Workspace Integration

Now that the Afterpay SDK resides in the Afterpay directory in the root of your working directory, it can be added to your project or workspace with the following steps:

  1. Open the new Afterpay directory, and drag Afterpay.xcodeproj into the Project Navigator of your application’s Xcode project or workspace.
  2. Select your application project in the Project Navigator to navigate to the target configuration window and select the application target under the “Targets” heading in the sidebar.
  3. In the tab bar at the top of that window, open the “General” panel.
  4. Click on the + button under the “Frameworks, Libraries, and Embedded Content” section.
  5. Select the Afterpay.framework for your target platform.

And that’s it, the Afterpay SDK is now ready to import and use within your application.