Skip to content

Installation

@qartvelo/react-native-ads brings Qartvelo Ads banner, interstitial and rewarded ads to React Native apps on Android and iOS. It is a thin bridge: campaign selection, timeouts, AdMob fallback, request de-duplication and the reward-once guarantee all run in the native Android SDK and iOS SDK. The JavaScript layer validates arguments, returns typed results and forwards events.

  • New Architecture only: a TurboModule (NativeQartveloAds) and a Fabric component (QartveloAdsBannerView), generated by codegen and autolinked.
  • Android and iOS are supported. On web every promise rejects with unsupported_platform, <QartveloAdsBanner /> renders nothing and QartveloAds.isSupported() returns false, so shared code runs everywhere.
React Native 0.79 or newer with the New Architecture enabled (newArchEnabled=true, the default)
iOS React Native minimum deployment target (15.1 for RN 0.79; newer RN releases may require more)
Android minSdk 24, compileSdk 35 or newer
Build JDK 17
Expo Bare workflow or a development build (expo prebuild); not Expo Go

Built and tested with React Native 0.87 (React 19.2); the native code only uses React Native APIs available since 0.79.

Terminal window
npm install @qartvelo/react-native-ads
# or: yarn add @qartvelo/react-native-ads
Terminal window
cd ios
pod install
cd ..
npx react-native run-ios

The package includes the native Swift SDK and privacy manifest. CocoaPods automatically links RNQartveloAds. No additional SPM package, CocoaPods trunk publication or credentials are required. Avoid linking a second copy of QartveloAds into the same application target.

The plugin depends on the native SDK com.qartvelo.ads:core:0.6.1, published on Maven Central. React Native and Expo projects already list mavenCentral(), so there is nothing to add. (Pinning a version before 0.3.4 with QartveloAds_sdkVersion needs JitPack: maven { url "https://jitpack.io" } in allprojects.repositories. To try an SDK build from ./gradlew publishToMavenLocal in android/, set QartveloAds_useMavenLocal=true in android/gradle.properties and add mavenLocal() to allprojects.repositories.)

When Qartvelo Ads has no ad, the SDK can show an ad from your own AdMob account. Configure it in one place; the App IDs (with ~) come from your AdMob apps.

Add the plugin to app.json and run npx expo prebuild (or build with EAS):

{
"expo": {
"plugins": [
[
"@qartvelo/react-native-ads",
{
"admob": {
"androidAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy",
"iosAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~zzzzzzzzzz",
"delayAppMeasurementInit": true
}
}
]
]
}
}

The plugin turns on the native adapter on both platforms, writes the App IDs to AndroidManifest.xml and Info.plist, and adds Google’s recommended SKAdNetwork identifiers (skAdNetworkItems adds more). An invalid App ID stops the prebuild with a message naming the key.

Put the same object under a top-level key in your app’s app.json:

{
"name": "MyApp",
"@qartvelo/react-native-ads": {
"admob": {
"androidAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy",
"iosAppId": "ca-app-pub-xxxxxxxxxxxxxxxx~zzzzzzzzzz"
}
}
}

Then run pod install and rebuild. The Android build adds the adapter and the App ID; on iOS the podspec adds the adapter and a build phase writes the App ID and SKAdNetwork list into the built Info.plist on every build. The phase is a short script that finds the installed package at build time (through NODE_BINARY from ios/.xcode.env), so the Xcode project you commit holds no path of your machine.

In development, debuggable Android builds use Google’s test units for the fallback (admobTestUnitsInDebugBuilds, default true); every iOS install outside the App Store does too.

AdMob ad unit ids differ per platform: pass them to admobAdUnits as { android, ios } values (Usage).

QartveloAds_admobEnabled=true in android/gradle.properties and ENV['QARTVELO_ADS_ADMOB_ENABLED'] = 'true' in the Podfile still work, with the App IDs set in your own AndroidManifest.xml and Info.plist.

The TurboModule and banner component are compiled into the app, so rebuild after installing or upgrading:

Terminal window
npx react-native run-android

A JavaScript reload is not enough: calls reject with module_unavailable until the native app is rebuilt.

For a local backend at http://10.0.2.2:8000/, allow cleartext in debug builds:

android/app/src/debug/res/xml/network_security_config.xml
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">localhost</domain>
</domain-config>
</network-security-config>
android/app/src/debug/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="UnusedAttribute" />
</manifest>

localhost keeps Metro working on physical devices through adb reverse tcp:8081 tcp:8081.

Next: Usage.