Referral and attribution SDK for Poikus apps: guest tracking, first-touch attribution, post-login linking, and referral code/summary reporting.
- iOS 16+ / macOS 13+
- Swift 6
- Depends on
PKSCore,PKSNetwork
.package(url: "https://github.com/POIKUS-LLC/PKSReferralKit.git", .upToNextMinor(from: "0.1.0"))Inside the poikussource monorepo, Package.swift resolves PKSCore/PKSNetwork from GitHub by
default (pinned to a released version), so a fresh checkout is always prod-ready with no extra setup.
To build against the sibling pkscore/pksnetwork folders on disk instead — e.g. while developing
these packages together — export:
export PKS_LOCAL_PACKAGES=1before running swift build, swift test, or xcodebuild. This only applies inside the monorepo,
where the sibling package folders actually exist.
import PKSReferralKit
let referral = PKSReferral(configuration: PKSReferralConfiguration(
baseURL: URL(string: "https://api.example.com")!,
identityStrategy: WebKeyStrategy(keyID: "wk_...", secret: "...", origin: "https://app.example.com"),
keychainService: "com.example.app.referral"
))
let outcome = await referral.trackAttributionOnLaunch()
// after login:
let linkOutcome = try await referral.linkAfterLoginIfNeeded()Apache-2.0