Using EOS SDK on iOS

How to implement EOS SDK in an iOS project using Xcode

The Epic Online Services (EOS) SDK is integrated into an iOS project as a framework. This document will review how to add the framework into a project, and assumes that you are using Xcode 10.3.1.

Before implementing the SDK with iOS, be sure to review the general guidelines and references for platform implementation.

1. Project Setup

This guide assumes that you already have an iOS project set up in Xcode to link the SDK with. Apple's guide on Creating an Xcode Project for an App will walk you through the process of starting a new project if you do not already have one.

There are two requirements for developing with the EOS SDK:

  • You must disable bitcode for your project.

  • You need a connected device to run the project with the linked SDK.

This guide uses the initial file structure from a new Single View App project in Xcode 10.3.1.

SDK Framework

When you download the SDK from the Developer Portal, you should find the following framework files and file structure inside the downloaded zip:

        - EOSSDK
        - Headers

2. Adding the Framework to the File Structure

Once you have downloaded the framework, we need to add it to the project. For this example, we have named our project "Test."

  1. Create a Frameworks directory in your project root folder in Finder.

    Click to enlarge image

  2. Copy the EOSSDK.framework file into Frameworks directory.

    Click to enlarge image

This will make the framework available to link to your project.

3. Linking the Framework to Your Project

  1. In Xcode, drag the framework from the Frameworks directory into Target > General > Frameworks, Libraries and Embedded Content.

    Click to enlarge image

  2. Verify that the added framework's Target Membership is your app.

    Click to enlarge image

4. Embed Binaries

  1. Open the Embed Binary Target > General > Embedded Binaries dropdown menu, then select "+".

  2. Select the added EOSSDK framework.

    Click to enlarge image

The project will now have the EOSSDK.framework file embedded and linked.

Click to enlarge image

5. Embed Dependencies

  1. Open the Embed Binary Target > General > Embedded Binaries dropdown menu, then select "+".

  2. Locate and add AuthenticationServices.framework.

    Click to enlarge image

    Click to enlarge image

Framework Dependencies

EOS SDK uses the AuthenticationServices.framework for iOS 12+ to support login flows and iOS 13+ for Sign in with Apple login.

For iOS 11 the login flows are supported by SafariServices.framework, which is a deprecated API and may be removed by Apple in the future and is only supported for limited backwards compatibility.

Final Result

Build and run the app onto your device to ensure everything is working properly. At this point, the SDK can be integrated with the app as intended. You can refer to a the default iOS projects for illustrations of possible APIs using Objective-C, Objective-C++ and Swift.