Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Magnite SDK for Swift Package Manager

Swift Package Manager (SPM) is the dependency manager built into Xcode. You can use it to add the Magnite SDK to your iOS app.

Prerequisites

  • Xcode 14.0 or later
  • iOS 11.0 or later as the deployment target

Add the package in Xcode

  1. In Xcode, open your project and go to File > Add Package Dependencies…
  2. In the search field at the top right, enter the package URL:
    https://github.com/MagniteEngineering/swift-package-manager
    
  3. Under Dependency Rule, select Up to Next Major Version and enter the latest version (for example, 1.0.6).
  4. In Add to Project, select your project and click Add Package.
  5. When Xcode finishes resolving the package, select the MagniteSDK library, choose your app target in the Add to Target column and click Add Package.

To check that it worked, open your app target and go to General > Frameworks, Libraries, and Embedded Content. MagniteSDK should appear in the list.

Add the package in Package.swift

If you are building your own Swift package, add the Magnite SDK to the dependencies of your Package.swift:

dependencies: [
    .package(
        url: "https://github.com/MagniteEngineering/swift-package-manager.git",
        .upToNextMajor(from: "1.0.6")
    ),
],

Then add the product to your target:

targets: [
    .target(
        name: "YourTarget",
        dependencies: [
            .product(name: "MagniteSDK", package: "swift-package-manager"),
        ]
    ),
]

Import the SDK

Swift:

import MagniteSDK

Objective-C:

@import MagniteSDK;

You don't need to link any system frameworks yourself. The package links everything it needs (AdSupport, AppTrackingTransparency, WebKit, StoreKit and others).

Update the SDK

  • To update to the latest version allowed by your dependency rule, go to File > Packages > Update to Latest Package Versions.
  • To move to a new major version, select your project, open the Package Dependencies tab, double-click swift-package-manager and change the version rule.

Remove the SDK

Select your project in the Project navigator, open the Package Dependencies tab, select swift-package-manager and click the – button.

Troubleshooting

  • "No such module 'MagniteSDK'": check that the MagniteSDK library is added to the right target, then run File > Packages > Reset Package Caches.
  • The package won't resolve: make sure you can reach github.com from your machine, then run File > Packages > Resolve Package Versions.

License

See LICENSE.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages