Paddle License Keys
1. Configure the Paddle Webhook
- Configure Paddle Webhook.
2. Create a one-time Product with the Paddle console
- Configure a one-time Paddle Product you can choose the "Server Notification" or "License List" delivery method.
4. Create the SKU
Create the SKU using a Paddle Product ID and optionally add a custom duration to the license code. If you do so the license is valid from the purchase date to the purchase date + duration.
5. Add the SKU to a Permission
6. Create a checkout page as described here
7. Connect the license key with the user
Create a UI element to allow the user to add the received license key and use the following code to connect it.
do {
try await Glassfy.connectPaddle(licenseKey: license, force: false)
print("Connected \(license)")
} catch {
print("Failed to connect license key: \(error)")
}
// Or, with closures:
Glassfy.connectPaddle(licenseKey: license, force: false) { error in
// handle error
}
[Glassfy connectPaddleLicenseKey:licenseKey
force:force
completion:^(NSError *error) {
// Handle errors
}];
Glassfy.connectPaddleLicenseKey(licenseKey, force) { error ->
// Handle error
}
try {
await Glassfy.connectPaddleLicenseKey(licenseKey, force);
console.log(`Connected ${licenseKey}`);
} catch (error) {
console.log(`Error connecting license key ${error}`);
}
try {
await Glassfy.connectPaddleLicenseKey(licenseKey, force);
console.log(`Connected ${licenseKey}`);
} catch (error) {
console.log(`Error connecting license key ${error}`);
}
await Glassfy.connectPaddleLicenseKey("license_key", true);
You can only connect a license code to 1 user. You will get an error if you try to reuse an existing license code connected to another user.
You can call
connectPaddle
withforce == true
to disconnect the other user and connect the new one.
Updated over 1 year ago