An open-source SDK for integrating in-app purchases on React Native

Implement in-app purchases in 30 minutes.

Out-of-the-box back end for React Native 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.
import { adapty } from 'react-native-adapty';
await adapty.activate('YOUR_APP_KEY');
 
// Make a purchase, Adapty handles the rest
try {
	const profile = await adapty.makePurchase(product);
	// successful purchase
} catch (error) {
	// handle the error
}
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 React Native in-app purchases

.makePurchase()
.restorePurchase()
.identify()
.updateProfile()
.updateAttribution()
// Your app's code
try {
   const profile = await adapty.makePurchase(product);
   const isSubscribed = profile?.accessLevels['YOUR_ACCESS_LEVEL']?.isActive;
 
	if (isSubscribed) {
		// grant access to features in accordance with access level
	}
} catch (error) {
	// handle the error
}
// Your app's code
try {
   const profile = await adapty.restorePurchases();
   const isSubscribed = profile.accessLevels['YOUR_ACCESS_LEVEL']?.isActive;
 
	if (isSubscribed) {
		// restore access
	}
} catch (error) {
	// handle the error
}
// Your app's code
try {
    await adapty.identify("YOUR_USER_ID");
    // successfully identified
} catch (error) {
    // handle the error
}
 
 
 
 
// Your app's code
try {
    await adapty.updateProfile(params);
} catch (error) {
    // handle `AdaptyError`
}
 
 
 
 
 
import { adapty, AttributionSource } from 'react-native-adapty';
import appsFlyer from 'react-native-appsflyer';
 
appsFlyer.onInstallConversionData(installData => {
	try {
		// It's important to include the network user ID
		const networkUserId = appsFlyer.getAppsFlyerUID();
		adapty.updateAttribution(installData, AttributionSource.AppsFlyer, networkUserId);
	} catch (error) {
		// handle error
	}
});
 
// ...
appsFlyer.initSdk(/*...*/);
Try for free

Industry leaders choose Adapty

Cem Ortabas, Co-founder and CEO, HubX
“Migrating off RevenueCat was not an easy decision for us. We’ve chosen Adapty because we believe they are a better partner as we grow. Looking back it was the right call. Despite some hiccups, the Adapty team was always there to help us during the migration and afterward, and their support is top-notch. I recommend Adapty as a reliable partner.”
Cem Ortabas
Co-founder and CEO, HubX
Logo HUBX (white)
Chris Bick, Founder and CEO, Bickster
“We’ve been working with Adapty since 2021 and I couldn’t be happier about it. We’ve tried other subscription management platforms in the past so I can compare. Adapty introduced numerous features over the years and constantly helped us grow. They have the best analytics on the market and all the integrations you can think of. If you looking to boost the revenue of your app, I definitely recommend Adapty.”
Chris Bick
Founder and CEO, Bickster
Bickster Logo
Asman
“We chose Adapty for its powerful paywall A/B testing capabilities, which helped us optimize our monetization strategy effectively. The user-friendly platform, flexible pricing, and exceptional customer support make Adapty a superior choice over competitors.”
Yalçın Özdemir
Founder & CEO, AppNation
Logo AppNation White
Kyle2
"Adapty's platform makes it easy for non-developers to create and manage A/B tests, paywalls, product mix and pricing structure. They have a great external API that makes it easy to pass related events to other analytics tools like Amplitude and Mixpanel."
Kyle Smith
Head of data at Smitten Dating
Smitten (Color Logo)
Roi Mulia, Founder & CEO, SocialKit
“We’ve tested more than three hundred paywalls in the space of four months. Adapty allows testing basically any element of the paywall, and we took advantage of that. We’ve tested them all: products, title text, CTA buttons, images, videos etc. With Adapty’s A/B testing, we managed to double our monthly revenue. I wasn’t sure if one instrument could make such an impact, but I witnessed it myself.”
Roi Mulia
Founder & CEO, SocialKit
Logo Social White

What do you get with Adapty?

Adapty SDK provides tremendous possibilities for growing app revenue

Real-time analytics for your React Native 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

Rating: 4.7
Based on 500+ reviews
Subscription Revenue Management High Performer High Performer
Subscription Revenue Management Fastest Implementation GoLiveTime
Subscription Analytics Best Relationship Total
Subscription Analytics Best Usability Total
Mobile App Analytics Most Implementable Total
This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.