一键导入
ios-sdk-reference
// Use when you need to read, understand, or reference the native iOS AdaptySDK-iOS source code — for understanding bridge contracts, porting new features, debugging native behavior, or checking JSON request/response formats
// Use when you need to read, understand, or reference the native iOS AdaptySDK-iOS source code — for understanding bridge contracts, porting new features, debugging native behavior, or checking JSON request/response formats
| name | ios-sdk-reference |
| description | Use when you need to read, understand, or reference the native iOS AdaptySDK-iOS source code — for understanding bridge contracts, porting new features, debugging native behavior, or checking JSON request/response formats |
Access the native AdaptySDK-iOS source code locally for reading and cross-referencing when working on the Unity wrapper.
The iOS SDK is cloned into .ios-sdk/ at the project root (gitignored).
Step 1: Check if .ios-sdk/ exists:
ls .ios-sdk/Sources 2>/dev/null
Step 2: If missing, clone it:
git clone git@github.com:adaptyteam/AdaptySDK-iOS.git .ios-sdk
Step 3: Determine which version/branch to use. Parse the current dependency version from Assets/AdaptySDK/Editor/AdaptySDKDependencies.xml (look for <iosPod name="Adapty" version="X.Y.Z">). Then ask the user which tag or branch to checkout, suggesting the dependency version as default. The user may want an unreleased branch instead.
Step 4: Checkout the confirmed version:
cd .ios-sdk && git fetch --all --tags && git checkout <tag-or-branch>
.ios-sdk/
├── Sources/ # Core Adapty SDK
│ ├── Adapty.swift # Main SDK class
│ ├── Adapty+*.swift # Public API extensions (GetPaywall, MakePurchase, etc.)
│ ├── Backend/ # HTTP API layer
│ ├── Backend.HTTPSession/ # Network session
│ ├── Configuration/ # SDK configuration
│ ├── Environment/ # Device/environment info
│ ├── Events/ # Analytics events
│ ├── Placements/ # Paywall placements
│ ├── Profile/ # User profiles
│ ├── StoreKit/ # StoreKit integration
│ └── LifecycleManager.swift # App lifecycle
│
├── Sources.AdaptyPlugin/ # Cross-platform bridge (THIS IS THE KEY DIRECTORY)
│ ├── AdaptyPlugin.swift # Main plugin entry: execute(method:withJson:)
│ ├── cross_platform.yaml # API contract schema (JSON formats)
│ ├── Requests/ # One file per SDK method (37+ handlers)
│ │ ├── Request.Activate.swift
│ │ ├── Request.GetPaywall.swift
│ │ ├── Request.MakePurchase.swift
│ │ └── ...
│ ├── Codable/ # JSON encoding/decoding for models
│ └── Events/ # Event definitions pushed to Unity
│
├── Sources.AdaptyUI/ # Visual paywall rendering
├── Sources.UIBuilder/ # Paywall template builder
├── Sources.KidsMode/ # Kids mode support
├── Sources.Logger/ # Logging framework
├── Sources.DeveloperTools/ # Debug tools
├── Tests/ # Unit tests
├── Adapty.podspec # CocoaPods spec
└── Package.swift # Swift Package Manager manifest
# In Sources.AdaptyPlugin/Requests/ — one file per method
Glob: .ios-sdk/Sources.AdaptyPlugin/Requests/Request.*.swift
# Example: how does GetPaywall work?
Read: .ios-sdk/Sources.AdaptyPlugin/Requests/Request.GetPaywall.swift
# The cross_platform.yaml defines all request/response JSON schemas
Read: .ios-sdk/Sources.AdaptyPlugin/cross_platform.yaml
# Search for a specific method:
Grep: pattern="get_paywall" path=".ios-sdk/Sources.AdaptyPlugin/cross_platform.yaml"
# In Sources.AdaptyPlugin/Codable/
Glob: .ios-sdk/Sources.AdaptyPlugin/Codable/*.swift
Grep: pattern="AdaptyPaywall" path=".ios-sdk/Sources.AdaptyPlugin/Codable/"
Glob: .ios-sdk/Sources.AdaptyPlugin/Events/*.swift
# Public API methods are in Adapty+MethodName.swift
Glob: .ios-sdk/Sources/Adapty+*.swift
# Example: full purchase flow
Read: .ios-sdk/Sources/Adapty+MakePurchase.swift
Grep: pattern="struct Adapty" path=".ios-sdk/Sources/"
When working on the Unity side, the mapping is:
| Unity (C#) | iOS Bridge | iOS Core |
|---|---|---|
Adapty.cs methods | Sources.AdaptyPlugin/Requests/Request.*.swift | Sources/Adapty+*.swift |
Models/AdaptyFoo.cs | Sources.AdaptyPlugin/Codable/ | Sources/ model files |
JSON/AdaptyFoo+JSON.cs | Sources.AdaptyPlugin/Codable/ | N/A |
cross_platform.yaml (Unity root) | Sources.AdaptyPlugin/cross_platform.yaml | N/A |
AdaptyEventListener.cs | Sources.AdaptyPlugin/Events/ | Sources/Events/ |
The iOS dependency version is declared in:
Assets/AdaptySDK/Editor/AdaptySDKDependencies.xml
Look for: <iosPod name="Adapty" version="X.Y.Z">
Always confirm with the user before checking out a tag — they may be working against an unreleased branch.