No easy way out
A block is only worth something if it holds. While one is active, Pledge stops the blocked apps being deleted and requires automatic date and time, so changing the clock can’t end a block early.
Case study
An iOS app that blocks the apps that eat your time, with real money on the line if you unlock early. Keep your pledge and it costs nothing. Break it and you pay, and Pledge gives 60% of that payment to a charity you pick.
iPhone already has Screen Time limits, but they’re easy to wave away: one tap on “Ignore limit” and you’re back in. Nothing is lost by giving in.
We try harder to avoid a loss than to chase a reward.
Pledge makes giving in cost something. You set an amount you’d hate to lose, from $1 to $100. Keep the block and you pay nothing. To leave early you pay that amount, and the money does some good.
Also built: a Progress tab with streaks, time reclaimed and milestones; weekly and daily Screen Time insights; and an onboarding screen that draws where each dollar goes to scale (60% to charity, about 15% to Apple, the rest GST and running costs).
Pledge is a SwiftUI app (about 7,400 lines) plus four extensions that iOS runs on its own schedule, outside the app (about 1,500 lines). The extensions can’t talk to the app directly, so they share state through an App Group container. Nothing about the user leaves the phone; the backend only sees Apple’s purchase records.
Code I wroteService or platform
A block is only worth something if it holds. While one is active, Pledge stops the blocked apps being deleted and requires automatic date and time, so changing the clock can’t end a block early.
iOS wakes the monitor extension when a block starts, ends or hits a limit, and may deliver the same event twice, such as after a restart. Unlocks are stamped with an expiry so a repeated event never re-locks apps someone has paid to open.
The default block screen is generic. Pledge’s shield reads the shared container to show the biggest pledge still running, when the apps unlock, the streak at risk and the charity that would get the money.
Each purchase carries a token that identifies the chosen charity, not the person. Apple’s signed records are verified and stored, refunds are taken off, and the App Store privacy label stays at “Data Not Collected”.
Purchases can finish outside the normal flow, like Ask to Buy approvals or a payment cut off mid-way. Those are caught when they arrive and passed to the countdown, so a paid unlock always goes through and a refunded one never does.
Version 1 took payments through Stripe, but an early unlock is a digital purchase, so I rebuilt it on in-app purchase. The giving wording had to make clear Pledge donates in its own name, not collect donations. Apple also wouldn’t let me drop iPad.
I built the first version between February and July 2024 to learn Apple’s Screen Time APIs, and shipped it to the App Store that July. In July 2026 I came back to it for version 2.0: