๐ŸŽ

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

iOS15.0+
Xcode15.0+
Swift5.9+
Publisher API KeyContact info@avafli.com

Installation

Swift Package Manager (Recommended)

  1. In Xcode, go to File โ†’ Add Package Dependencies
  2. Enter the repository URL:
https://github.com/AVAFLI/winr_ios_sdk.git
  1. Select version 2.9.0 or later
  2. Add WINRSDK to 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:

AppDelegate.swift
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

Device registration & token management
Escalating streak ladder with milestone accelerators
Daily or visit-based streak modes
Winner announcements & celebrations
Auto-open on first daily app-open
Email & age gate capture
Geo-fence support
Certificate pinning
Built-in analytics
Push notification support
Anti-spam & rate limiting
Right-to-be-forgotten (GDPR)
Custom logo, prize image & brand color

Full API Reference & Code Examples

View the complete documentation on GitHub including API reference, code examples, and advanced configuration.