๐Ÿค–

Android SDK

Kotlin ยท Android 8+ ยท Jetpack Compose

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

Android8.0+ (API 26)
Kotlin2.1+
Jetpack ComposeBOM 2024.12.01+
Publisher API KeyContact info@avafli.com

Installation

Gradle (via JitPack)

Add JitPack to your project-level settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }
    }
}

Add the dependency to your app-level build.gradle.kts:

dependencies {
    implementation("com.github.AVAFLI:winr_android_sdk:v2.9.0")
}

Quick Start

The simplest integration requires just two calls:

MainActivity.kt
import com.avafli.winrsdk.WINR
import com.avafli.winrsdk.WINRConfiguration
import com.avafli.winrsdk.WINROptions
import com.avafli.winrsdk.WINRUser

val config = WINRConfiguration(
    context = applicationContext,
    apiKey = "YOUR_API_KEY",  // debug builds: use your winr_test_ sandbox key
    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 = WINRUser.GUEST
    options = WINROptions(
        debugLogging = false,         // true 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.onNewToken(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. Forward your FCM token to WINR:

class MyFirebaseMessagingService : FirebaseMessagingService() {
    override fun onNewToken(token: String) {
        super.onNewToken(token)
        WINRPushNotificationManager.instance.didReceiveRegistrationToken(token)
    }
}

Upload your FCM service account key via the WINR Dashboard to enable push notifications.

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
FCM 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.