My first app that checks a license

Blog post #77


Dockcam told me my trial had expired.

That is the app I built to turn my iPhone into a webcam for Windows. I have been using it since the start of September, and this week the seven-day trial I wrote myself ran out. The app refused to send video until I pasted in a key.

Then it accepted the key, showed my email address under “Licensed”, and got out of the way.

What shipped

  • A license key format: a small signed payload with the customer’s email and a purchase id. The app verifies the signature offline with a public key baked into the code. No server call at startup, no account.
  • A seven-day trial that survives a deleted settings file and a clock turned backwards.
  • A store on the server side, waiting for Stripe: payment in, key out, sent by email. The plumbing is tested; the Stripe account is not connected yet.

Why this matters more than it looks

Everything I have built so far has been free, for me or for people I know. That is a comfortable place, and it teaches you nothing about whether anyone would pay.

A license check is a tiny piece of code. What it changes is the question the app asks. Not “does this work?” but “is this worth 249 kronor to someone?” Dockcam is the first thing I own that can even ask that.

What’s unclear or broken

  • I was locked out of my own app for a day, because I had forgotten I already had a key signed for myself. Less dramatic than it sounds, and a good reminder to write things down.
  • The same day exposed two unrelated bugs: the app kept showing a QR code for a room the server had already dropped, and a settings dropdown had slipped outside the window. Both fixed, both would have been support tickets.
  • No one can buy it yet. Stripe, a domain for the store, and code signing are still on my list. That list is the actual next step.

Decisions made

  • One-time purchase, 249 kr, key valid forever. A subscription can come later if anyone asks for it.
  • Keys are deterministic: the same purchase always produces the same key, so a lost key can be recreated from the payment record without a database.

— Stefan