Skip to content

Repository files navigation

PKSReferralKit

Referral and attribution SDK for Poikus apps: guest tracking, first-touch attribution, post-login linking, and referral code/summary reporting.

Requirements

  • iOS 16+ / macOS 13+
  • Swift 6
  • Depends on PKSCore, PKSNetwork

Installation

.package(url: "https://github.com/POIKUS-LLC/PKSReferralKit.git", .upToNextMinor(from: "0.1.0"))

Local development

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=1

before running swift build, swift test, or xcodebuild. This only applies inside the monorepo, where the sibling package folders actually exist.

API

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()

License

Apache-2.0

About

Referral and attribution SDK for Poikus apps: guest tracking, first-touch attribution, post-login linking, and referral code/summary reporting.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages