Testing & Troubleshooting
Verify your Stay22 Mobile SDK integration in minutes and diagnose why a notification didn't show.
Test mode
In production the notification arrives on Stay22's schedule, after the user leaves your app — too slow for a development loop.
Stay22.testing.force = true
Stay22.testing.showLogs = true
Stay22.setTravelContext(TravelContext(address = "Paris, France"))testing.force schedules with a fixed 5-second delay and relaxes the relevance checks. testing.showLogs prints the SDK's decisions to the console. Enable both, background the app, and the notification appears about 5 seconds later. Tap it to verify the booking experience opens with your attribution.
Stay22.testing.force = true
Stay22.testing.showLogs = true
Stay22.setTravelContext(TravelContext(address: "Paris, France"))testing.force schedules with a fixed 5-second delay and relaxes the relevance checks. testing.showLogs prints the SDK's decisions to the console. Enable both, background the app, and the notification appears about 5 seconds later. Tap it to verify the booking experience opens with your attribution.
await Stay22.testing.setForce(true);
await Stay22.testing.setShowLogs(true);
await Stay22.setTravelContext(TravelContext(address: 'Paris, France'));testing.force schedules with a fixed 5-second delay and relaxes the relevance checks. testing.showLogs prints the SDK's decisions to the console. Enable both, background the app, and the notification appears about 5 seconds later. Tap it to verify the booking experience opens with your attribution.
await Stay22.setTravelContext({ address: 'Paris, France' });
await Stay22.forceNotification();forceNotification() needs a destination. Without one it emits a notificationSkipped event with reason missing_destination and nothing is scheduled. Call both, background the app, and wait a few seconds. Tap the notification to verify the booking experience opens with your attribution.
Never ship a build with testing.force, testing.showLogs, or forceNotification() in the binary you send to users.
Why didn't the notification show?
The SDK reports every held-back notification as a notificationSkipped, notificationBlocked, or notificationCancelled event with a reason — set an event handler and check it first. The usual suspects:
| Symptom | Check |
|---|---|
| Nothing happens at all | Is Stay22.isEnabled set to true? Did Stay22.initialize run at app launch with your aid? On Flutter and Capacitor, declare the partner ID natively — see Initialize at app launch. |
notification_permission_denied | The user declined the OS prompt — call Stay22.requestNotificationPermission() at a better moment, or guide them to system settings. |
app_foreground | Notifications only deliver after the user leaves the app. Background the app and wait. |
home_destination | The test destination matches the device's home area — test with a faraway city. |
local_cooldown | A notification was shown recently. Use testing.force (or forceNotification() on Capacitor) while developing, or wait out the cooldown. |
missing_destination | The travel context needs at least an address, coordinates, or hotel name. |
partner_config_disabled | Scheduling is switched off for your account — contact your Stay22 account manager or support@stay22.com. |
Also worth knowing while testing:
- Setting a new travel context replaces the pending notification — you'll see a
notificationCancelledfollowed by a freshnotificationScheduled. Stay22.clearTravelContext()drops the context and any pending notification, which is a clean way to reset between test runs.
Still stuck?
Enable testing.showLogs (or, on Capacitor, collect the stay22Event stream), reproduce the issue, and send the output along with your aid to support@stay22.com. The GitHub READMEs (Android, iOS, Flutter, Capacitor) also document the full API surface if you need details beyond these guides.