Superwall

Using Expo SDK in Bare React Native Apps

Install Superwall's Expo SDK in existing React Native projects without Expo

This guide is for React Native developers who want to integrate Superwall for the first time using our Expo SDK, even though their project doesn't use Expo.

This doesn't sound like you?

What are Expo Modules?

Expo Modules allow you to use Expo SDK packages in any React Native project, even if you're not using Expo as your development framework. This means bare React Native apps can benefit from Expo's ecosystem while maintaining their existing project structure.

Superwall's Expo SDK (expo-superwall) is now our recommended SDK for all React Native projects. By installing Expo Modules in your bare React Native app, you can use our latest SDK with the best features and support.

Prerequisites

Before starting, ensure you have:

  • A React Native project (compatible with React Native 0.79+)
  • iOS deployment target set to 15.1 or higher
  • Android minimum SDK version 21 or higher
  • Node.js 18 or newer

Step 1: Install Expo Modules

First, you need to install Expo modules in your React Native project. This allows you to use any Expo SDK package, including expo-superwall.

For comprehensive installation details, refer to Expo's official guide

Run the following command in your project root:

npx install-expo-modules@latest

This command automatically configures your iOS and Android projects to support Expo modules.

Manual Installation (If Automatic Fails)

If the automatic installation doesn't work (common in highly customized projects), follow these steps:

  1. Install the expo package:
npm install expo
  1. Configure your iOS project:

    • Set iOS deployment target to 15.1 in Xcode
    • Update your AppDelegate files as per Expo's manual instructions
    • Run npx pod-install to install iOS dependencies
  2. Configure your Android project:

    • Update android/settings.gradle and android/app/build.gradle
    • Follow the Android configuration steps in Expo's guide

Step 2: Install Superwall Expo SDK

Once Expo modules are configured, install the Superwall SDK:

npm install expo-superwall

Step 3: Platform-Specific Configuration

iOS Configuration

After installing the SDK, run:

cd ios && pod install

Android Configuration

Ensure your android/app/build.gradle has:

android {
    compileSdkVersion 34
    
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
    }
}

Troubleshooting

If you encounter any issues during installation, refer to Expo's installation guide for detailed troubleshooting steps and platform-specific configuration details.

What's Next?

Continue with the Superwall configuration guide to complete your setup.

How is this guide?