We are using RevenueCat to handle in-app purchases.

First, you need an Apple Developer & Google Play Developer Account to setup in-app purchases.

Setup

1

First, go to RevenueCat and create a account.

2

After you create your account, click on the Create Project button.

3

After creating your project, you need to define your project name.

4

Then, we are continuing with the tabs for platform-specific setup.

5

After completing two platform-specific setup, open your app/_layout.tsx file.

  • Add the RevenueCatProvider component.
import {
    RevenueCatProvider,
    useRevenueCat,
} from '@/context/RevenueCatProvider';
6

Find the useEffect hook in the App component.

//* If you want to use RevenueCat, uncomment the following lines 👇
const { initializeRevenueCat } = useRevenueCat();

useEffect(() => {
    ....
    getUserTrackingPermission();
    // Uncomment the following line 👇
    initializeRevenueCat(); 
}, []);
7

Wrap the RootLayout component with the RevenueCatProvider component.

const RootLayout = () => {
  return (
    <Provider store={store}>
      <AuthProvider>
        <RevenueCatProvider>
          {/* ... */}
        </RevenueCatProvider>
      </AuthProvider>
    </Provider>
  );
};
8

Now you can use the useRevenueCat hook to get the RevenueCat instance.

9

You need to configure your subscriptions on Google Play Console and App Store Connect.

I could have added this step too, but this is too specific for your project.

10

Then we are ready to some sellings 🎉