Quick Start

Install the Stay22 Mobile SDK, initialize it, and schedule your first accommodation notification.

This guide takes you from an empty project to a working integration: the SDK installed, the user opted in, and a trip handed to Stay22. You need your partner ID (aid) — the same one you use for Allez links.

Install the SDK

Add the Stay22 Maven repository in settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://raw.githubusercontent.com/Stay22/stay22-android-sdk/main/maven") }
    }
}

Then add the dependency:

dependencies {
    implementation("com.stay22:sdk:1.0.11")
}

In Xcode, go to File > Add Package Dependencies and enter:

https://github.com/Stay22/stay22-ios-sdk

Or add it to Package.swift:

dependencies: [
    .package(url: "https://github.com/Stay22/stay22-ios-sdk.git", from: "1.0.10")
]

Add the Stay22SDK product to your app target.

Check the Android releases and iOS releases for the latest version. Both repos also offer manual distribution (a raw .aar / .xcframework) — see their READMEs.

Initialize at app launch

Initialize once, as early as possible, with your partner ID. Set Stay22.isEnabled before initializing if you gate Stay22 offers behind your own consent flow — nothing is scheduled while it's false.

Call from Application.onCreate():

import android.app.Application
import com.stay22.sdk.Stay22

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()

        Stay22.isEnabled = userHasOptedInToStay22Offers
        Stay22.initialize(application = this, aid = "your-partner-id")
    }
}

Call early in your app launch:

import Stay22SDK

Stay22.isEnabled = userHasOptedInToStay22Offers
Stay22.initialize(aid: "your-partner-id")

Ask for notification permission

The SDK delivers standard local notifications, so the user has to grant notification permission. Request it at a moment that makes sense in your UX — ideally right after the user opts in to travel offers:

Stay22.requestNotificationPermission()

Handles the Android 13+ runtime permission; on older versions it's a no-op. Check the current state anytime with Stay22.hasNotificationPermission().

Task {
    await Stay22.requestNotificationPermission()
}

Prompts for local notification permission. Check the current state anytime with await Stay22.hasNotificationPermission().

Tell the SDK about the trip

This is the heart of the integration. Whenever your app learns about a trip — a booked flight, a searched destination, saved travel dates — pass it along. The SDK takes it from there:

import com.stay22.sdk.TravelContext

Stay22.setTravelContext(
    TravelContext(
        address = "Paris, France",
        checkinDate = "2026-03-20",
        checkoutDate = "2026-03-25"
    )
)
Stay22.setTravelContext(
    TravelContext(
        address: "Paris, France",
        checkinDate: "2026-03-20",
        checkoutDate: "2026-03-25"
    )
)

Every field is optional — a destination alone is enough to start. Dates use YYYY-MM-DD. You can also pass latitude/longitude for precision, or hotelName when the user searched a specific property.

If the trip is cancelled or the user clears their search, call Stay22.clearTravelContext() to drop the context and any pending notification.

See it work

In a normal run the notification arrives after the user leaves your app, on Stay22's schedule — which is the right behavior in production but slow for a first test. Flip on test mode to get the notification 5 seconds after backgrounding the app.

Platform setup notes

The SDK's manifest merges in everything it needs (INTERNET, POST_NOTIFICATIONS, and the activity that handles notification taps) — no required manifest changes. Optionally, give the notification your own status-bar icon:

<application>
    <meta-data
        android:name="com.stay22.sdk.notification_small_icon"
        android:resource="@drawable/ic_stat_notification" />
</application>

Add these entries to your Info.plist so the SDK can route the offer to a booking app the user already has installed:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>airbnb</string>
    <string>booking</string>
    <string>expda</string>
    <string>hotelsapp</string>
    <string>agoda</string>
</array>

Next steps

  • Notifications & Events — customize the notification copy and observe scheduling decisions
  • Testing & Troubleshooting — verify the full flow on a device
  • The GitHub READMEs (Android, iOS) carry the full API reference and a step-by-step integration guide you can hand to an AI coding agent

On this page