Get a quote
Mobile

Nightproof — A sleep noise app that recovers from interruptions

Our own iPhone app. It synthesizes masking noise on the phone, sample by sample, keeps playing after a call, an alarm or a headphone disconnect, and shows a log of the night each morning. A PHP server we wrote checks the one-time purchase a second time against Apple's signature.

Category Mobile
Client Algoriel product
Services Mobile App, System Architecture
Year 2026
Status In App Store review
Role Design & development

The context

Many people fall asleep to background noise. When a call, an alarm or a dropped AirPods connection cuts it off during the night, they find out in the morning, and nothing tells them when or why it went quiet.

We built Nightproof as our own product and made all-night playback its core promise, with a PHP server beside it that checks each purchase against Apple’s signature. The English-language app, with the US as its base market, is now in App Store review.

How we work on every project

Planning

We go through how the work runs today and what you expect from the software; the scope comes out of that.

Architecture

We decide what the system is made of and where its information is kept.

Modelling

We draw the screens and the flow before any code, and start building once you have approved them.

Development

We write and hand over the software so another team could carry it on.

See our process →

What we built

  • Noise synthesized sample by sample

    Seven textures, from white noise to a fan rumble, come out of separate filter chains. A test hashes buffers and fails on any repeated block.

  • One supervisor for every interruption

    Calls, alarms, route changes, media-services resets and engine reconfiguration land in one supervisor. When headphones drop, a setting decides between the speaker and a pause.

  • Recovery tested without real hardware

    The clock is passed in and audio hardware sits behind a protocol, so interruptions, route changes and stalls run in tests with no iPhone attached.

  • A night log that never leaves the phone

    Each night goes into SwiftData as a stream of fifteen event kinds. Played time sums only played segments, so gaps never count.

  • A PHP server that re-checks every purchase

    It accepts only chains ending in Apple Root CA G3, matched by SHA-256, judges validity at the signing date and refuses Xcode transactions.

  • Lifetime access that survives an outage

    A refund notice from Apple or a server rejection withdraws Lifetime access. A server outage does not: StoreKit's own check keeps it open.

How we built it

  • Swift
  • SwiftUI
  • Observation
  • SwiftData
  • Swift Concurrency
  • AVFoundation (AVAudioEngine, AVAudioSourceNode, AVAudioSession)
  • StoreKit 2
  • MediaPlayer
  • Security (Keychain)
  • PHP 8.3
  • php-jwt
  • PDO
  • SQLite
  • MySQL 8 / MariaDB
  • PHPUnit

Challenge and result

Each row is a pair: the challenge the work had to solve on the left, and how the system answers it on the right.
Challenge Result
A looped recording jumps back to the same point each time it reaches the end The phone computes every sample in code; the app carries no audio file at all
A call, an alarm or a headphone disconnect cuts in and stops the sound Sound returns once an interruption ends and moves to the iPhone speaker if headphones drop
The audio engine can stall with no reason from iOS, and that silence leaves no trace A stalled engine gets up to three restarts; failing that, the log notes when sound stopped
PHP has no official App Store Server Library, so the server checks Apple's signature itself The server pins Apple's root certificate, and a refund notice withdraws Lifetime access

Have a question about Nightproof?

Nightproof is in App Store review and cannot be downloaded until Apple signs it off. You can send us your question about it.