SDK news: free trials with card, major versions and a clock you can't fool

What OwnLicense's Swift, C#, Rust and PHP SDKs gained in November, led by free trials with a card on subscriptions.

The four OwnLicense SDKs (Swift for Mac, C# for Windows, Rust for Linux and PHP for WordPress) had a busy month. The latest addition was requested by one of our own apps, Arca Mail Backup, and it’s the one customers will notice most: subscriptions with a few free days where the card is collected upfront.

Today’s versions are Swift 0.8.0, C# 0.6.0, Rust 0.4.0 and PHP 0.5.0, with server 1.31.0.

Free trial with card

Until now we had a no-card trial: the user requested it from the app, got a key by email and had Pro for a few days. It’s a good way to get to know an app, but when it ends the user has to remember to come back and buy.

The new one works the other way round. Each subscription plan can have some free days (1 to 30). At checkout the card is collected but nothing is charged until they’re over. Unless the customer cancels, Stripe charges the first period automatically and the subscription carries on like any other. Arca gives 7 days on its yearly plans; the lifetime license has no trial.

What the server does:

  • The license works from day one, with its plan, units and features. The key arrives by email when the trial starts and is activated as usual.
  • One trial per email and app, even if they cancel and come back. Stripe doesn’t enforce that, so the purchase page asks for the email before checkout (or gets it from the app) and, if that email already had a trial, says so and the payment is taken right away.
  • No grace period during the trial. If the customer cancels, they keep Pro until the last day of the trial and then go back to free. Same if the first charge fails, and if Stripe manages to charge later, Pro comes back on its own.
  • A reminder two days before the charge, with the date and the amount. Stripe only sends one for trials longer than 7 days, so we send it ourselves, in the customer’s language.
  • Honest stats. Starting a trial isn’t counted as a sale, since no money came in. The sale is recorded when the first charge goes through.

What the SDKs gain: the signed token the app keeps now carries the end of the trial, so the app knows offline whether it’s on trial and until when. Settings can say “On trial until November 23” instead of “Renews on…”, with a button to manage the subscription. Prices now include each plan’s free days, so the paywall can say “7 days free, then €34.99/year”, and the purchase link can carry the user’s email so they don’t have to type it again.

Apps on an older SDK don’t break. They see a normal subscription that renews on the last day of the trial, and start showing “on trial” as soon as they update.

Licenses per major version

Since Swift 0.7.0 and C# 0.5.0 (and Rust 0.3.0 and PHP 0.4.0), a license can cover only up to a given major version. It’s meant for the day an app ships a paid v2: whoever bought v1 keeps it forever, the app tells them “your license covers up to version 1” and offers two buttons, one to pay just for the upgrade to v2 with the same key and another to download v1 if they’d rather stay there.

It’s ready and switched off. Everything sold so far covers all versions, and that won’t change unless an app decides otherwise.

A clock you can’t fool

A license that’s checked offline depends on the device’s clock, and anyone can change the clock. We had already handled the case of someone turning it back so an expired subscription works again. In November, a review of iSkitch found the opposite: someone who sets the clock a day ahead by mistake and then fixes it. The SDK kept the future time and stopped asking for renewals when it should.

Since Swift 0.7.1, C# 0.5.1, Rust 0.3.1 and PHP 0.4.1 that no longer happens: the SDK trusts the time the server signs on every renewal, and the check schedule follows the device clock. However the customer’s clock is set, the license does the right thing.

The same tests for all four

As we explained in one license for Mac, Windows and Linux, the test cases come from the server itself: real tokens signed by its code, plus what each SDK must answer. The card trial brought a new case, and none of the four SDKs passed until they all read it the same way.

If you want to use it

The Swift, C# and Rust SDKs are in production in our apps, and the PHP one for WordPress is in testing. If you sell software outside the app stores and like the idea of running this in your own Cloudflare account, see how it works, the API and SDKs or join the waitlist. Every change, with its date, is in the changelog.

  • #Licensing
  • #SDK
  • #Subscriptions
  • #Stripe

← All posts · RSS feed

Want it in your own account?

Ask for the private beta with your GitHub username: it's free, by invitation, and we review every request by hand.