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

  1. Open your project in Xcode.
  2. In your application’s project file, create a new group.
  3. Download the framework and move it to the created group.
  4. In the Choose options for adding these files window that appears, check the Copy items if needed box and click Add.
  5. Check that the framework is in a group and has a location relative to the group:

    1. In the project file tree, select the added framework.
    2. Make sure that in the Identity and Type block, the Location field is set to Relative to Group.

  1. Go to project settings.
  2. Select the target with the name of your project.
  3. Go to the General > Frameworks, Libraries, and Embedded Content section and click on the + icon.
  4. In the Choose frameworks and libraries to add window that appears, select the Subscriptions library framework and click Add.
  5. In the Embed field, select Embedded & Sign.
  6. Add the following line to the project’s Swift files where you plan to use SDK methods:
Copy
Full screen
Small screen
    import SubscriptionsKit
    

    Import SDK project into workspace

    1. Open your project in Xcode.
    2. If you didn’t use a workspace to organize your project, create one:
      1. Click File > New > Workspace in the main menu.
      2. In the window that appears, select the folder with the project file and click Save.

    1. In the project file tree, select the workspace of your project.
    2. Select Add Files to from the context menu.
    3. In the window that appears, select your application’s project file, uncheck the Copy items into destination group’s folder (if needed) box and click Add.
    4. Close Xcode.
    5. Open the workspace of your project.
    6. Download the SDK project folder.

    1. In the project tree, select a directory convenient for you.
    2. Select Add Files to from the context menu.
    3. In the window that appears, select the folder with the SDK project, uncheck the Copy items into destination group’s folder (if needed) and click Add.
    4. Go to project settings.
    5. Select the target with the name of your project.
    6. Go to the General > Frameworks, Libraries, and Embedded Content section and click on the + icon.
    7. In the Choose frameworks and libraries to add window that appears, select the Subscriptions library project folder and click Add.
    8. In the Embed field, select Embedded & Sign.
    9. Add the following line to the project’s Swift files where you plan to use SDK methods:
    Copy
    Full screen
    Small screen
      import SubscriptionsKit
      
      Was this article helpful?
      Thank you!
      Is there anything we can improve? Message
      We’re sorry to hear that
      Please explain why this article wasn’t helpful to you. Message
      Thank you for your feedback!
      We’ll review your message and use it to help us improve your experience.
      Last updated: January 22, 2024

      Found a typo or other text error? Select the text and press Ctrl+Enter.

      Report a problem
      We always review our content. Your feedback helps us improve it.
      Provide an email so we can follow up
      Thank you for your feedback!