Docs · Weather
Weather notifications
Weather in Pushbrain has two layers: a free dashboard preview that sends to your test devices, and Pro production automations that gate real sends on each device’s live weather.
Free: Integration → Test weather notification (test devices).
Pro: Automations with weather conditions for real audience sends.
View pricing → Try it free (preview)
You can try weather end-to-end on any plan without wiring location into your app. The Integration-tab test button fetches live weather, optionally writes AI copy from your app brief, and sends only to devices marked as test.
Free preview — test devices onlyWeather test does not gate your production audience. It always targets test devices and uses the city you type in the dashboard — not each user’s stored location.
- Open your app → Integration → Test weather notification.
- Enter a city (and optional country), e.g. Hyderabad, India.
- In Audience, mark at least one device as a test device.
- Leave “Use AI for notification copy” checked so OpenAI uses your app brief + weather.
- Click Test weather notification — you should see weather + send status in the result banner.
See plans →
Upgrade for production weather
Weather-gated Automations (scheduled jobs that only send where rain / clear / temperature matches) require Pro or Scale. Free keeps the preview so you can validate weather + AI before upgrading.
Pro required for production weather-gated sendsCreating or updating a scheduled job with a weather condition returns an upgrade error on Free. Preview via Integration → Test weather notification stays available.
- Pro unlocks weather conditions on scheduled jobs.
- Production sends use each device’s city or lat/lng from the SDK — not the Integration test city.
- AI Autopilot on those jobs uses your app brief plus a weather context for the matched condition.
Upgrade to Pro →Create an automation →
Enable location collection
Before production weather gating works, turn on location collection for the app. Pushbrain never looks up location itself — it only stores what your app sends after you opt in.
- Integration → Location & weather-aware sends → enable Location collection.
- Get user consent before collecting city or coordinates in your app.
- If location collection is off, city/lat/lng from the SDK are silently dropped server-side.
- Devices without location on file are skipped by weather-gated jobs (they still get normal notifications).
SDK: send city or coordinates
On every token registration, include at least city or both lat and lng. Re-register when location changes.
- Flutter / Android: add city, lat, lng to the POST /sdk/register-token JSON body (see platform snippets).
- React Native: pass city / lat / lng on init — your app must obtain coordinates.
- City-only lookups need OpenWeather or WeatherAPI on the server; WeatherUnion needs lat/lng.
await pushbrain.init({
sdkKey: 'pb_YOUR_KEY_HERE',
// ...firebase config
// Option A — you already have location:
city: 'Bangalore',
lat: 12.9716,
lng: 77.5946,
// Option B — ask the browser (separate from notification permission):
// requestLocation: true,
});
Platform snippets →
Create a weather-gated automation
On Pro+, open Automations → new scheduled job. Pick fixed or AI Autopilot content, set a cron/schedule, choose audience, then enable “Only send where the weather currently matches.”
- Operators: Raining (includes drizzle + thunderstorm), Clear / sunny, Cloudy, Snowing, Temperature below / above (°C).
- Weather checkbox stays disabled until location collection is on.
- Fill AI Studio app brief + job AI goal/instructions for better Autopilot copy.
- Confirm devices show a city when you search Audience before relying on production gating.
How it works at send time
When the cron fires, Pushbrain loads the audience, fetches live weather per device location (30-minute cache), keeps only matches, then sends fixed or AI copy.
- Unknown / failed weather for a device = skip that device (not “assume match”).
- AI jobs generate one title/body for the whole run; weather filtering decides who receives it.
- Production AI gets a condition description (e.g. raining in the recipient’s area), not per-city exact temperatures.
- Server needs at least one weather API key configured (OPENWEATHER_API_KEY, WEATHERAPI_API_KEY, and/or WEATHERUNION_API_KEY).
Test vs production
| Integration weather test | Production weather-gated job |
|---|
| Plan | Free + Pro + Scale | Pro + Scale |
| Location source | City you type in the dashboard | Each device’s SDK city / lat / lng |
| Who receives | Test devices only | Audience ∩ live weather match |
| Gating | None — preview send | Per-device weather filter at cron time |
| Needs location collection | No (for the preview itself) | Yes |
| AI context | Actual reading + temp for test city | Condition text + app brief |
Limitations
- Drip / lifecycle campaigns do not support weather conditions yet — scheduled jobs only.
- One AI message per automation run (not personalized per city’s exact temperature).
- Pushbrain does not geocode or reverse-geocode — your app must send city and/or coordinates.
- WeatherUnion is coordinates-only; city-name tests and city-only devices need OpenWeather or WeatherAPI.
- You are responsible for privacy consent before collecting location.
Checklist (e.g. Flutter finance app)
- Fill AI Studio app brief (purpose, tone, goals).
- Integration → enable Location collection.
- Add city / lat / lng to your register-token call (e.g. notifyme.dart / pushbrain.dart).
- Mark a test device → run Integration → Test weather notification (Free).
- Upgrade to Pro → Automations → weather condition → schedule production sends.
Ready to run weather in production?
Preview on Free, then upgrade to Pro for weather-gated automations.
View pricing →