Handling App Store Promo Codes

You can display a sheet that enables users to redeem subscription offer codes that you configure in App Store Connect by using the following code


If you are checking the status of the subscriptions using the permissions everything is handled transparently by Glassfy, but if you want to be notified when a purchase is completed successfully you need to implement a delegate as in the following example.

class AppDelegate: [...], Glassfy.PurchaseDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        Glassfy.initialize(apiKey: "YOUR_API_KEY")

    func didPurchaseProduct(transaction: Glassfy.Transaction) {
        // handle transation
        // see transaction documentation here https://docs.glassfy.io/docs/transaction