Swift SDK

Swift SDK

Swift Package Manager via git tags. iOS and macOS. This stub will mirror sdks/swift/README.md.

Install

Add the Meridian Ads git repository and take the Swift product from sdks/swift. GitLab package registry plus tags are the v1 distribution. There is no CocoaPods feed in v1.

Swift
// Package.swift
.package(
  url: "https://git.yelle.software/yelle/saas/meridian-ads.git",
  from: "0.1.0"
)
// product from sdks/swift (path in the monorepo)
// pin a git tag; this page will match sdks/swift/README.md

Serve, render, click

API names below are illustrative until the README ships. Fire impression when the banner or native unit is on screen. Open clickURL so the adserver can 302. Do not attach user_key to any landing query you control.

Swift
import MeridianAds

let client = try Client(configuration: Configuration(
  appKey: ProcessInfo.processInfo.environment["MERIDIAN_ADS_APP_KEY"] ?? "",
  secret: ProcessInfo.processInfo.environment["MERIDIAN_ADS_SECRET"] ?? ""
))

if let decision = try await client.serve(
  placement: "home",
  userKey: "user-42"
) {
  try await client.recordImpression(for: decision)
}

Next

Clicks and sandbox versus production .