An open-source SDK for integrating in-app purchases on Unity

Implement in-app purchases in 30 minutes.

Out-of-the-box back end for Unity in-app purchases

Integrating in-app purchases requires creating a backend infrastructure and server for subscription events. This can take hundreds of hours of work and be challenging to maintain.
import StoreKit
class Store: ObservableObject {
    private var productIDs = ["stone"]
    @Published var products = [Product]()
    init() {
        Task {
            await requestProducts()
        }
    }  
    @MainActor
    func requestProducts() async {
        do {
            products = try await Product.products(for: productIDs)
        } catch {
            print(error)
    }
  }
}
Section(header: Text("To buy")) {
 }
ForEach(store.products, id: \.id) {
  product in
    HStack {
      Text(product.displayName)
      Spacer()
      Button("\(product.displayPrice)") {
    }
  }
}
@Published var purchasedNonConsumables = [Product]()
@MainActor
func purchase(_ product: Product) async throws -> Transaction ? {
  let result =
    try await product.purchase()
  switch result {
    case .success(.verified(let transaction)):
      purchasedNonConsumables.append(product)
      await transaction.finish()
      return transaction
    default:
      return nil
  }
}
Button("\(product.displayPrice)") {
 Task {
  try await store.purchase(product)
  }
}
ProductView(
 icon: "❀",
 quantity: "\(store.purchasedNonConsumables.count)"
 )
 func listenForTransactions() -> Task < Void, Error > {
  return Task.detached {
    for await result in Transaction.updates {
      switch result {
        case let.verified(transaction):
          guard
          let product = self.products.first(where: {
            $0.id == transaction.productID
          })
          else {
            continue
          }
          self.purchasedNonConsumables.append(product)
          await transaction.finish()
        default:
          continue
      }
    }
  }
}
var transacitonListener: Task<Void, Error>?
init() {
   transacitonListener = listenForTransactions()
   Task {
     await requestProducts()
 }
}
@MainActor
private func handle(transactionVerification result: VerificationResult <Transaction> ) async {
  switch result {
    case let.verified(transaction):
      guard
      let product = self.products.first(where: {
        $0.id == transaction.productID
      })
      else {
        return
      }
      self.purchasedNonConsumables.insert(product)
      await transaction.finish()
    default:
      return
  }
}
Adapty SDK enables you to integrate in-app subscriptions into your iOS app with our ready-made infrastructure, which handles all subscription events and offers revenue-growing features.
// Your app's code
using AdaptySDK;
 
Adapty.makePurchase(product, (profile, error) => {
	if (error == null) {
		// successful purchase
	}
});
From integration to maintenance – Adapty is created to make working with IAP easier.
Request a demo

Why choose Adapty SDK?

Correct subscription state at any moment

Rest assured you’ll always get the correct subscriber state across all platforms.

Server-side receipt validation

No need to worry about the correctness and safety of purchase validation.

Handling all kinds of subscription states

Free trials, upgrades, promo offers, family sharing, renewals, and more.

Enterprise-ready platform with a short release cycle

>99.99% SLA reliability and regular product updates.
Configuring platforms
Installing Adapty SDK
Adapty.activate(
   "PUBLIC_SDK_KEY",
   customerUserId: "YOUR_USER_ID"
)
Processing purchasing events

Fast and easy integration

Spend only a couple of hours to integrate the Adapty SDK into your iOS app and we’ll take care of the rest.

Just 5 SDK methods to implement Unity in-app purchases

// Your app's code
Adapty.MakePurchase(product, (profile, error) => {
    if(error != null) {
        // handle error
        return;
    }
});
 
 
// Your app's code
Adapty.RestorePurchases((profile, error) => {
    if(error != null) {
        // handle the error
    } else {
        // check the access level
    }
});
 
// Your app's code
Adapty.Identify("YOUR_USER_ID", (error) => {
    if(error == null) {
        // successful identify
    }
});
 
 
 
// Your app's code
var builder = new Adapty.ProfileParameters.Builder()
    .("Profile_Parameters")
 
Adapty.UpdateProfile(builder.Build(), (error) => {
    if(error != nil) {
        // handle the error
    }
});
// Your app's code
Adapty.UpdateAttribution("<attributions>", source, "<networkUserId>", (error) => {
    if (error != null) {
        // handle the error
    }
  
   // succesfull attribution update
});
 
Try for free

People from all kinds of businesses turn to Adapty to grow their revenue

What do you get with Adapty?

Adapty SDK provides tremendous possibilities for growing app revenue

Real-time analytics for your Unity App

Rely on the data with 99.5% accuracy with App Store Connect.
Get started
App Icon Gravity
Gravity Fit
Health & Fitness
“Transparent and advanced analytical dashboards help us make decisions faster without using additional tools. It saves us a lot of time and, therefore, money.”
Ekaterina K,
PM at Gravity Fit
Accuracy Adapty Appstore
ABC testing

Paywall A/B testing

Find the most profitable paywall and grow your app’s revenue.
Explore A/B testing
MentalGrowth
MentalGrowth
Health & Wellness app
“Adapty’s fast analytics and easy-to-launch A/B testing feature have allowed us to validate hypotheses quickly and achieve great results.”
Vadim Nemchenko,
Product Manager at MentalGrowth

Remote config for paywalls

Change your paywall remotely without having 
to re-release the app.
Try it now
Smitten
Smitten - Dating
Lifestyle
“Our growth and revenue team is able to rapidly implement and manage paywalls, product offers, and test pricing tiers across many different markets.”
Kyle Smith,
Head of data at Smitten Dating
Table Json Table Locale

Trusted for usability and customer service

Based on 500+ reviews
G2 Award: Best Results, winter 2025
G2 Award: High Performer, winter 2025
G2 Award: Best Usability, winter 2025
G2 Award: Best Relationship, winter 2025
G2 Award: Most Implementable, winter 2025