All Projects → CleanCocoa → TrialLicensing

CleanCocoa / TrialLicensing

Licence: MIT license
Swift framework to deal with licensing and time-based trial periods in macOS apps.

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to TrialLicensing

TrialMaker.Demo
A powerful yet straight-forward library suite that provides secure trial license generation and copy-protection features for .NET applications. It also supports premium license generation for expired free-trials.
Stars: ✭ 21 (-41.67%)
Mutual labels:  license, trial
EspBuddy
Wrapper to easily upload (OTA or Serial), backup, batch query, monitor ESP8266 boards using Esptool.py, Espota.py and Platformio
Stars: ✭ 47 (+30.56%)
Mutual labels:  serial
Saxi
Tools & library for driving the AxiDraw pen plotter
Stars: ✭ 234 (+550%)
Mutual labels:  serial
license-ls
Get a list of licenses used by a projects dependencies
Stars: ✭ 17 (-52.78%)
Mutual labels:  license
LibSerialPort.jl
Julia wrapper for the libserialport c library
Stars: ✭ 54 (+50%)
Mutual labels:  serial
NAGPythonExamples
Examples and demos showing how to call functions from the NAG Library for Python
Stars: ✭ 46 (+27.78%)
Mutual labels:  trial
Ohsce
PHP HI-REL SOCKET TCP/UDP/ICMP/Serial .高可靠性PHP通信&控制框架SOCKET-TCP/UDP/ICMP/硬件Serial-RS232/RS422/RS485 AND MORE!
Stars: ✭ 206 (+472.22%)
Mutual labels:  serial
uPy-rosserial
An implementation of rosserial for uPy.
Stars: ✭ 19 (-47.22%)
Mutual labels:  serial
sandia-public-license
This is not a license of honor. No highly esteemed copyright statement is written here.
Stars: ✭ 114 (+216.67%)
Mutual labels:  license
neato-serial
Python serial interface for Neato robot vacuum cleaners. Testing on XV Signature Pro, should work on others.
Stars: ✭ 39 (+8.33%)
Mutual labels:  serial
SimpleLicensing
A Go Based Licensing System for Digital Rights Management
Stars: ✭ 96 (+166.67%)
Mutual labels:  license
bluetooth-terminal
ES6 class for serial communication with your own Bluetooth Low Energy (Smart) devices
Stars: ✭ 43 (+19.44%)
Mutual labels:  serial
jrxtx
The Java serial communication library.
Stars: ✭ 74 (+105.56%)
Mutual labels:  serial
Nodemcu Tool
🔧 Upload + Manage Lua files on NodeMCU
Stars: ✭ 248 (+588.89%)
Mutual labels:  serial
friends-and-lovers-license
what if code i wrote was only for the people i love?
Stars: ✭ 61 (+69.44%)
Mutual labels:  license
Adalight Fastled
Adalight with FastLED support
Stars: ✭ 232 (+544.44%)
Mutual labels:  serial
Huhnitor
Intergalactic serial monitor for ESP8266 Deauther
Stars: ✭ 265 (+636.11%)
Mutual labels:  serial
convey
Communication through a serial port or named pipe
Stars: ✭ 46 (+27.78%)
Mutual labels:  serial
ckwin
C-Kermit for Windows - scriptable internet and serial communications with terminal emulation
Stars: ✭ 35 (-2.78%)
Mutual labels:  serial
scancode.io
ScanCode.io is a server to script and automate software composition analysis pipelines with ScanPipe pipelines. This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ Google Summer of Code, nexB and others generous sponsors!
Stars: ✭ 66 (+83.33%)
Mutual labels:  license

Time-Based Trial App Licensing

Adds time-based trial and easy license verification using CocoaFob to your macOS app.

Carthage compatible

For setup instructions of your own store and app preparation with FastSpring, have a look at my book Make Money Outside the Mac App Store!

Installation

Swift Package Manager

dependencies: [
  .package(url: "https://github.com/CleanCocoa/TrialLicensing.git", .upToNextMajor(from: Version(3, 0, 0))),
]

Add package depencency via Xcode by using this URL: https://github.com/CleanCocoa/TrialLicensing.git

CocoaFob is automatically linked statically for you, no need to do anything.

Carthage

  • Include the Trial and TrialLicense libraries in your project.
  • Include the CocoaFob (Swift 5) library in your project, too. (You have to link this in the app because a library cannot embed another library.)

Usage

  • Create an AppLicensing instance with licenseChangeBlock and invalidLicenseInformationBlock handling change events.
  • Set up and start the trial.

Example:

import TrialLicense

let publicKey = [
        "-----BEGIN DSA PUBLIC KEY-----\n",
        // ...
        "-----END DSA PUBLIC KEY-----\n"
    ].join("")
let configuration = LicenseConfiguration(appName: "AmazingApp!", publicKey: publicKey)

class MyApp: AppLicensingDelegate {

    init() {

        AppLicensing.setUp(
            configuration: configuration,
            initialTrialDuration: Days(30),

            // Set up the callbacks:
            licenseChangeBlock: self.licenseDidChange(licenseInfo:),
            invalidLicenseInformationBlock: self.didEnterInvalidLicenseCode(name:licenseCode:),

            // Get notified about initial state to unlock the app immediately:
            fireInitialState: true)
    }

    func licenseDidChange(licenseInformation: LicenseInformation) {

        switch licenseInformation {
        case .onTrial(_):
            // Changing back to trial may be possible if you support unregistering
            // form the app (and the trial period is still good.)
            return

        case .registered(_):
            // For example:
            //   displayThankYouAlert()
            //   unlockApp()

        case .trialUp:
            // For example:
            //   displayTrialUpAlert()
            //   lockApp()
            //   showRegisterApp()
        }
    }

    func didEnterInvalidLicenseCode(name: String, licenseCode: String) {

        // For example:
        //   displayInvalidLicenseAlert()
        // -- or show an error label in the license window.
    }
}

let myApp = MyApp()

Components

LicenseInformation reveals the state your app is in:

enum LicenseInformation {
    case registered(License)
    case onTrial(TrialPeriod)
    case trialUp
}

The associated types provide additional information, for example to display details in a settings window or show remaining trial days in the title bar of your app.

License represents a valid name--license code pair:

struct License {
    let name: String
    let licenseCode: String
}

TrialPeriod encapsulates the duration of the trial.

struct TrialPeriod {
    let startDate: Date
    let endDate: Date
}

TrialPeriod also provides these convenience methods:

  • ended() -> Bool
  • daysLeft() -> Days

... where Days encapsulates the remainder for easy conversion to TimeInterval and exposing userFacingAmount: Int for display.

License

Copyright (c) 2016 by Christian Tietze. Distributed under the MIT License. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].