Hi DEV, I'm Thanh, a solo developer. I build AhaBox, an Android app with 29 small brain games and 22 everyday tools (pomodoro timer, habit streaks, water reminder and so on). In the latest update I added seven daily puzzles, where everyone in the world gets the same puzzle each day. Here are a few notes from building them in React Native.

Stack: Expo SDK 54, React Native 0.81, Reanimated 4, AsyncStorage for local data, Google Mobile Ads.

1. "Same puzzle for everyone" without a server

The easy answer is a backend that serves today's puzzle. I wanted the games to work on a plane, so the puzzle is generated on the device from the date instead.

  • Build a date key like 2026-11-25.
  • Hash it together with the game name (daily_challenge_2026-11-25) into an integer.
  • Feed that integer into a small deterministic PRNG (Park–Miller is enough for puzzles).
  • Run the puzzle generator with that PRNG instead of Math.random.
function seededRandom(seed: number): () => number { let s = seed % 2147483647 || 1; return () => { s = (s * 16807) % 2147483647; return (s - 1) / 2147483646; }; } function hashString(str: string): number { let hash = 0; for (let i = 0; i < str.length; i++) { hash = (hash << 5) - hash + str.charCodeAt(i); hash |= 0; } return Math.abs(hash); } const rng = seededRandom(hashString(`daily_challenge_${dateKey}`)); 

Two things matter if you do this:

  • Every random call has to go through the seeded PRNG, and in the same order. If a generator retries ("this layout has two solutions, try again"), the retry has to use the same stream, so every phone takes the same path.
  • Don't change the generator after release without versioning the seed. Otherwise players on the old and new app versions see different puzzles on the same day.

2. The 7 AM bug: UTC vs. local date

My first version used new Date().toISOString().slice(0, 10) as the date key. That's the UTC date. In Vietnam (UTC+7) the "daily" puzzle rolled over at 7 in the morning, so a player who solved it at 6:50 AM got a brand-new puzzle ten minutes later, and their streak logic got confused.

The fix is boring but important: build the key from the device's local calendar.

const pad = (n: number) => String(n).padStart(2, '0'); export function localDateKey(date: Date = new Date()): string { return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`; } 

Parse it back as local midnight too (new Date(y, m - 1, d)), not new Date('2026-11-25'), which is UTC midnight. Every streak, "played today" flag and habit tracker in the app now uses the same helper.

3. No network while playing

Games and tools never call the network while you play. Scores, streaks, habits and focus sessions are stored on the phone in AsyncStorage, and there's no sign-up. Ads are the only part that needs a connection, and if they fail to load, the game just carries on.

4. Ads that don't ruin a 60-second game

Short games and full-screen ads don't mix well, so the rules are strict:

  • at most one interstitial every 3 rounds,
  • at least 3 minutes apart, and a daily cap,
  • rewarded ads are always opt-in,
  • the 7 daily puzzles have no banners and no interstitials at all.

5. A spoiler-free share card

Each daily puzzle ends with a share card that shows your time and streak but not the solution, so people can post it in a group chat without spoiling it for friends.

If you want to see how the daily puzzles play, the rules for each game are here: AhaBox games. The app is free with ads on Android, and iOS is coming soon.

Happy to answer questions about seeded generation, streaks across time zones, or keeping 29 games in one React Native app.