Install library
Install the library in your project in one of the following ways:
Note
Importing an SDK project into a workspace allows you not only to call methods to work with Xsolla products, but also to work with the source code of the library.
Import framework into project
- Open your project in Xcode.
- In your application’s project file, create a new group.
- Download the framework and move it to the created group.
- In the
Choose options for adding these files window that appears, check theCopy items if needed box and clickAdd . - Check that the framework is in a group and has a location relative to the group:
- In the project file tree, select the added framework.
- Make sure that in the
Identity and Type block, theLocation field is set toRelative to Group .
- Go to project settings.
- Select the target with the name of your project.
- Go to the
General > Frameworks, Libraries, and Embedded Content section and click on the + icon. - In the
Choose frameworks and libraries to add window that appears, select the Subscriptions library framework and clickAdd . - In the
Embed field, selectEmbedded & Sign . - Add the following line to the project’s Swift files where you plan to use SDK methods:
Copy
import SubscriptionsKit
Import SDK project into workspace
- Open your project in Xcode.
- If you didn’t use a workspace to organize your project, create one:
- Click
File > New > Workspace in the main menu. - In the window that appears, select the folder with the project file and click
Save .
- Click
- In the project file tree, select the workspace of your project.
- Select
Add Files to from the context menu. - In the window that appears, select your application’s project file, uncheck the
Copy items into destination group’s folder (if needed) box and clickAdd . - Close Xcode.
- Open the workspace of your project.
- Download the SDK project folder.
- In the project tree, select a directory convenient for you.
- Select
Add Files to from the context menu. - In the window that appears, select the folder with the SDK project, uncheck the
Copy items into destination group’s folder (if needed) and clickAdd . - Go to project settings.
- Select the target with the name of your project.
- Go to the
General > Frameworks, Libraries, and Embedded Content section and click on the + icon. - In the
Choose frameworks and libraries to add window that appears, select the Subscriptions library project folder and clickAdd . - In the
Embed field, selectEmbedded & Sign . - Add the following line to the project’s Swift files where you plan to use SDK methods:
Copy
import SubscriptionsKit
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Found a typo or other text error? Select the text and press Ctrl+Enter.