Search code examples
reactjsreact-nativegithubads

I want to integrate IronSource ad network with my react native project


I have found a framework for integrating IronSource ad network with my react native project here.

I have a searched a lot in internet and have already tried opening an issue in the repository but no luck.

I did as it said in the readme file like so:

First installing the dependency

npm install @wowmaking/react-native-iron-source --save

Then linking the dependency

react-native link @wowmaking/react-native-iron-source

And finally importing the dependency

import { IronSource } from '@wowmaking/react-native-iron-source';

But as soon as I try to run my application I get this error:

native module cant be null

I don't know if I'm doing it right or not please help!

I'm using react native 0.60.5


Solution

  • I'm contributor of @wowmaking/react-native-iron-source. Readme was updated for RN 60 last month. You dont need to link it anymore for RN 60.

    1. npm install @wowmaking/react-native-iron-source --save

    2. Add a repo to your android/app/build.gradle file

    allprojects {
        repositories {
            // Existing repos here
            // ...
    
            maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
        }
    }
    

    You are ready to run your app.

    1. Add mediation networks which you need. Follow official docs. https://github.com/wowmaking/react-native-iron-source#mediation-setup