Skip to content

Installation

The SDK ships as a Swift package. The module and product name is AppGantrySDK.

Add the package

In Xcode use File > Add Package Dependencies…, enter the repository URL, and set the dependency rule to Commit — there are no versions to choose from yet. Or add it to your own Package.swift:

dependencies: [
    .package(
        url: "https://github.com/AppGantry/iOS-SDK.git",
        revision: "<commit-sha>"
    ),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [.product(name: "AppGantrySDK", package: "iOS-SDK")]
    ),
]

Replace <commit-sha> with a full commit hash from the commit history, and see the caveat below for why it isn't a branch.

Then import it where you use it:

import AppGantrySDK

Requirements

  • iOS 16.0 or later. The package also builds for macOS 13 or later, which is a build requirement, not a claim that AppGantry distributes macOS apps. See Platform support.
  • Swift 5.9 or later.

Early-development caveat

Pin to a commit while there is no tagged release

The SDK is in early development and has no tagged releases yet, so there is no version to depend on. Depend on an explicit commit instead: revision: resolves to exactly that SHA and never moves on its own, which makes every upgrade a deliberate edit you can review.

Don't use branch: "main". A branch requirement re-resolves to whatever main points at, so an unrelated swift package update can pull in source-breaking changes with no diff in your project.

Committing your Package.resolved is a useful second safeguard — it records the resolved SHA for everyone building the project — but it is not a substitute for the pin: it is regenerated on resolution, and on a branch requirement it moves with the branch.

Watch the releases page for the first tagged version, and see Versioning & compatibility for what to expect until then.

Troubleshooting

Symptom Cause Fix
No such module 'AppGantrySDK' The product isn't linked to the target that imports it Add .product(name: "AppGantrySDK", package: "iOS-SDK") to that target's dependencies, or tick the target in Xcode's package UI
Xcode offers no versions to choose from There are no tagged releases yet Use the Commit dependency rule, or revision: "<commit-sha>" in Package.swift
The package resolves to a different commit than a colleague's Someone depended on a branch, so resolution moved Pin revision: to an explicit SHA and commit Package.resolved
A swift package update broke the build with no diff in your project Same cause: a branch requirement re-resolved Pin to a commit. See the caveat above
Build fails with a deployment-target error The package requires iOS 16 and Swift 5.9 Raise the target's minimum deployment version, or update Xcode
It builds for macOS but the app isn't distributed macOS is a build target only, not a distribution platform See Platform support
You're not on Swift at all There is no Android or cross-platform package Call the HTTP API directly — it is the same seven operations the package uses

Next