UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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.

Requirements:

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.

4      

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.

4      

thank you i will look it up.

3      

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.

3      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out 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.