Integration

This guide explains how to install the React Native bridge and configure both Android and iOS native projects.

Step 1: Install the Package

npm install @empower-nokta/react-native-mobile-ads

Or with Yarn:

yarn add @empower-nokta/react-native-mobile-ads

The package supports autolinking — no manual native linking is needed.


Step 2: Android Configuration

Add the Maven Repository

Add the Empower Maven repository to your project-level android/build.gradle:

// android/build.gradle
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://maven.empower.net/release' }
}
}

Or if your project uses settings.gradle (newer RN versions):

// android/settings.gradle
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url 'https://maven.empower.net/release' }
}
}

Configure AndroidManifest

Add the following <meta-data> tags inside the <application> block of android/app/src/main/AndroidManifest.xml:

<application>
<!-- Existing configuration -->
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true"/>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>

Note: Replace the APPLICATION_ID value with your actual Google Ads Application ID. Contact Empower support if you need assistance obtaining this ID.

Kotlin Version Compatibility

If you encounter Kotlin version conflicts, add this to android/build.gradle:

// android/build.gradle
allprojects {
configurations.all {
resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-stdlib:1.9.0"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0"
}
}
}

And in android/gradle.properties:

kotlin.suppressKotlinVersionCompatibilityCheck=2.3.0

Step 3: iOS Configuration

Install CocoaPods Dependencies

cd ios && pod install && cd ..

Update Your Podfile

Add the Empower specs source to the top of your ios/Podfile:

source 'https://github.com/empowernet/specs.git'
source 'https://cdn.cocoapods.org/'

Ensure use_frameworks! is present in your target block:

target 'YourApp' do
use_frameworks!
# ...existing pods...
end

Then run:

cd ios && pod install --repo-update && cd ..

Update Info.plist

Add your Google Ads Application ID to ios/YourApp/Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Update Build Settings

Add ${inherited} to Other Linker Flags in your Xcode project:

Target → Build Settings → Other Linker Flags


Step 4: Build and Run

# Android
npx react-native run-android
# iOS
npx react-native run-ios

Optional: Mediation Adapters

Android

The SDK includes built-in mediation support. For additional ad networks, add these repositories to android/build.gradle:

// settings.gradle.kts
dependencyResolutionManagement {
repositories {
// ... existing repositories
// For additional mediation networks
maven { url = uri("https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea") }
maven { url = uri("https://artifact.bytedance.com/repository/pangle") }
maven { url = uri("https://android-sdk.is.com/") }
maven { url = uri("https://cboost.jfrog.io/artifactory/chartboost-ads/") }
}
}
// build.gradle (project-level)
allprojects {
repositories {
// ... existing repositories
// For additional mediation networks
maven { url 'https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea' }
maven { url 'https://artifact.bytedance.com/repository/pangle' }
maven { url 'https://android-sdk.is.com/' }
maven { url 'https://cboost.jfrog.io/artifactory/chartboost-ads/' }
}
}

Mediation Adapter Dependencies

Add any required mediation adapters based on your monetization strategy:

// app/build.gradle.kts
dependencies {
// AppLovin Mediation
implementation("com.applovin.mediation:google-adapter:24.9.0.0")
implementation("com.applovin.mediation:google-ad-manager-adapter:24.9.0.0")
implementation("com.applovin.mediation:inmobi-adapter:11.1.1.0")
implementation("com.applovin.mediation:vungle-adapter:7.7.0.0")
implementation("com.applovin.mediation:bytedance-adapter:7.8.6.0.0")
implementation("com.applovin.mediation:unityads-adapter:4.16.6.0")
Google AdMob Mediation
implementation("com.google.ads.mediation:inmobi:11.1.0.1")
implementation("com.google.ads.mediation:pangle:7.8.5.9.0")
implementation("com.google.ads.mediation:unity:4.16.6.0")
implementation("com.unity3d.ads:unity-ads:4.16.6")}
// AppLovin Mediation
implementation 'com.applovin.mediation:google-adapter:24.9.0.0'
implementation 'com.applovin.mediation:google-ad-manager-adapter:24.9.0.0'
implementation 'com.applovin.mediation:inmobi-adapter:11.1.1.0'
implementation 'com.applovin.mediation:vungle-adapter:7.7.0.0'
implementation 'com.applovin.mediation:bytedance-adapter:7.8.6.0.0'
implementation 'com.applovin.mediation:unityads-adapter:4.16.6.0'
Google AdMob Mediation
implementation 'com.google.ads.mediation:inmobi:11.1.0.1'
implementation 'com.google.ads.mediation:pangle:7.8.5.9.0'
implementation 'com.google.ads.mediation:unity:4.16.6.0'
implementation 'com.unity3d.ads:unity-ads:4.16.6'
}

iOS

Add the mediation adapter pods to your ios/Podfile:

target 'YourApp' do
use_frameworks!
# Mediation Adapters
pod 'AppLovinMediationGoogleAdManagerAdapter'
pod 'AppLovinMediationGoogleAdapter'
pod 'AppLovinMediationInMobiAdapter'
pod 'AppLovinMediationVungleAdapter'
pod 'AppLovinMediationByteDanceAdapter'
pod 'AppLovinMediationUnityAdsAdapter'
pod 'AppLovinMediationYandexAdapter'
pod 'GoogleMobileAdsMediationInMobi'
pod 'GoogleMobileAdsMediationPangle'
pod 'GoogleMobileAdsMediationUnity'
end

Then run cd ios && pod install --repo-update.

Note: Contact your Empower account manager for the recommended adapter configuration based on your target markets and revenue goals.


Troubleshooting

Native Module Not Found

If you see @empower-nokta/react-native-mobile-ads: Native module not found:

Android: 1. Run: cd android && ./gradlew clean && cd .. && npx react-native run-android 2. Ensure maven { url 'https://maven.empower.net/release' } is in android/build.gradle

iOS: 1. Run: cd ios && pod install && cd .. && npx react-native run-ios 2. Ensure source 'https://github.com/empowernet/specs.git' is in your Podfile 3. Ensure use_frameworks! is in your Podfile

Kotlin Version Mismatch

If you see errors about Kotlin version incompatibility, apply the resolution strategy and suppressKotlinVersionCompatibilityCheck as described in the Android Configuration section above.

Build Fails After Adding Mediation Adapters

Run a clean build:

# Android
cd android && ./gradlew clean && cd ..
# iOS
cd ios && pod deintegrate && pod install --repo-update && cd ..