Requirements
The WinWinKit SDK is available in native Swift and supports iOS 16 and macOS 13 or later.Installation
Swift Package Manager You can use Swift Package Manager to add WinWinKit to your Xcode project:- In Xcode select “File” -> “Add Packages Dependencies”
- Enter the repository URL:
- Press “Add Package”.
import WinWinKit
in your source files.
Configuration
Configure the SDK with the API key and set the referral user’s App User Id.Update user properties
Is Premium Update is premium property to track referring user’s stats and enable rewards activation on conversion.For automatic updates of the
is_premium
flag, enable integration with
RevenueCat. To do this, go to your project in
WinWinKit and navigate to Settings -> Integrations page.User
User object contains all necessary information needed to display in the user interface. Access the latest user object.
Also available as a property of ReferralsObservableObject
(see below).
Claim Code
Claim a code for a user. Code can be affiliate, promo or referral code.Fetch Offer Code
Withdraw Credits
SwiftUI
The SDK provides convenientObservable
object to interact and observe changes in SwiftUI views.
ReferralsObservableObject
Provides observable User
object, methods and states for interacting with WinWinKit service.
In SwiftUI only apps it is possible to build complete integration with only
this observable object.
User Interface
The SDKs provide interface for interacting with WinWinKit APIs, but not the UI. Thus you need to build the user interface for the referral feature in your app. We plan to provide UI with the SDK in the future. Please let us know if that is your requirement to get started.Delegate
Optionally set a delegate to receive events from the SDK.Setting the delegate is optional when using the observable object described above.
Requirements
- iOS 16.0+
- macOS 13.0+
- Xcode 15.0+
- Swift 5.0+
Check out the SDK on GitHub