iOS SDK
Swift ยท iOS 15+ ยท Xcode 15+
Overview
WINR lets you add daily-entry sweepstakes and prize experiences to your app with a single configuration call. The SDK automatically opens the experience on the first app-open of each day, captures the user, and claims their daily entries โ no scheduling or session logic on your side. You customize your logo, prize image, and brand color from the WINR dashboard; everything else is managed server-side.
Requirements
| iOS | 15.0+ |
| Xcode | 15.0+ |
| Swift | 5.9+ |
| Publisher API Key | Contact info@avafli.com |
Installation
Swift Package Manager (Recommended)
- In Xcode, go to File โ Add Package Dependencies
- Enter the repository URL:
https://github.com/AVAFLI/winr_ios_sdk.git- Select version
2.9.0or later - Add
WINRSDKto your app target
CocoaPods
Add the pod to your Podfile and run pod install:
pod 'WINRSDK', '~> 2.8'Quick Start
The simplest integration requires just two calls:
import WINRSDK
let config = WINRConfiguration(
apiKey: "YOUR_API_KEY", // debug builds: use your winr_test_ sandbox key
bundleId: "com.example.myapp",
user: WINRUser(
id: "user_123", // only id is required โ pass whatever identity you have
firstName: "Jane",
lastName: "Doe",
email: "jane@example.com" // include it when you have it โ pre-fills & locks the capture form
),
// Nobody signed in? use user: .guest
options: WINROptions(
logging: .error, // use .debug while integrating
enablePushReminders: true // streak reminders via YOUR Firebase project
)
)
WINR.configure(config)
// Done โ the experience auto-opens once per day.
// Push reminders: forward your FCM token: WINR.didReceiveFCMToken(token)
The experience opens itself on the first app-open of each day โ there is no manual launch API. Presentation timing, the daily cadence, and dismissal are fully managed by the SDK.
Push Notifications
Drive re-engagement with daily reminders โ sent through your own Firebase project. Forward your FCM registration token (and the standard APNs callbacks) to WINR:
// In your AppDelegate
// MessagingDelegate โ server pushes need the FCM token
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
if let fcmToken { WINR.didReceiveFCMToken(fcmToken) }
}
func application(
_ application: UIApplication,
didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
WINR.didRegisterForRemoteNotifications(deviceToken: deviceToken)
}Reminders are sent through your own Firebase project โ upload your Firebase service account key via the WINR Dashboard, and forward your FCM registration token with WINR.didReceiveFCMToken(token). Apps without Firebase Messaging fall back to daily local reminders automatically.
Testing? Your dashboard also shows a winr_test_ sandbox key. Use it in debug builds: identical behavior against the production backend, but users and entries land in an isolated sandbox โ your testers can never enter your real giveaway, and sandbox usage never counts toward MAU.
SDK Features
Full API Reference & Code Examples
View the complete documentation on GitHub including API reference, code examples, and advanced configuration.