Saksham Saraswat
Saksham Saraswat

Reputation: 81

How to add product key functionality to an ios app

I have made a Swift application and I want to distribute the application on the basis of a Product key or a license key. I am not going to publish this app to the app store, I am going to build the app on company devices and give them a product key, since I want to distribute to many companies. The app will ask for a product key for the first time and never again.

One way I thought was to have a product key model with a regex, but I have been stuck on it for a long time. Anyone has any idea?

Upvotes: 0

Views: 656

Answers (2)

Luke Joshua Park
Luke Joshua Park

Reputation: 9806

DRM is an age-old problem that literally cannot be solved. Your question somewhat trivializes this. A good rule of thumb to observe: if your software is running on a users computer, they can do whatever they want with it - this includes avoiding any DRM you've implemented.

There are ways around this though - don't run the software on the users computer. For example, if the primary purpose of the software is to convert word documents to PDF, extract this functionality to an API service and instead use your product key solution as an authorization solution to use the service.

My general point is that you are approaching this problem wrong, it cannot be solved when the software is running under the complete control of the user.

Upvotes: 1

Sam King
Sam King

Reputation: 1020

I'm not sure if this is more of a full stack question, so I would say create a simple login screen and use the product key and set of unique company email addresses to map to. So say I work at Grizzle: my product key has been given to me as '12345' and my email is [email protected] Then you could write an endpoint that accepts these two parameters and validates them against a known list of product keys paired with emails on your backend.

You can also distribute this app via TestFlight and have people download it via a public link(just released at WWDC this year). That way you wouldn't have to manually install on each phone AND you can have up to 10,000 users using it on TestFlight.

Upvotes: 0

Related Questions