TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

How to implement trail version with activate deactivate license?

Forums > macOS

I am working on a macOS desktop application using SwiftUI and am looking for a way to implement a trial version that expires after a specific period (e.g., 7 days). Additionally, I want to include the functionality to activate and deactivate a software license.


When the user first installs the app, they should be able to use it for a 7-day trial period. After the trial period, the user should be prompted to enter a software license key to continue using the app. The user should have the option to deactivate the license on their machine, so it can be used on a different machine. I understand that this will likely involve both client-side and server-side logic. However, I am particularly interested in how to achieve this in SwiftUI for the client-side aspect.

I look for a basic example that implements this preferrable integration with stripe or other payment provider

Im looking for advice Searched paddle and stripe repros for examples but havent found anyrhing like this.

Sure there must exist an example not having to reinvent the wheel

an beatefull example of what i mean is sipapp

they implement paddle bit nowhere in paddle githib i find an example app that does imement the licensing like this with a trail period.


Enter Christian Tietze in a search engine. His blog should be one of the first results. In the Writing section is the page Ultimate FastSpring Guide for Selling Mac Apps. That page has some information that should help.

I would link to the page, but the forum limits the domains you can link to. I was unable to post when I linked to the page.


thank you i will look it up.


To implement a trial version with license activation and deactivation in a macOS desktop application using SwiftUI, start by creating a timer for the trial period and adjusting the app's functionality based on the timer status. Provide a user interface for entering license keys and validate them either locally or through server communication, possibly using a payment provider like Stripe. Allow users to deactivate licenses and ensure the deactivated keys can be used on other machines. While specific SwiftUI examples with Stripe integration may be limited, you can adapt general concepts and explore third-party libraries or services for this functionality. Secure implementation is vital to prevent misuse and piracy, so consider consulting experts or specialized licensing solutions as needed.


Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.