React-native-admob: Package does not work with react native 38

Created on 7 Dec 2016  路  11Comments  路  Source: sbugert/react-native-admob

I have used this package since react native 20 or so. I recently went from react native 37 to 38 and ads are no longer served. I downgraded back to 37 and this issue was resolved.

Most helpful comment

IOS: Same issue, on 0.37 the package works fine but when i switch to 0.39 it stop working.

screen shot 2017-01-05 at 3 26 05 pm

All 11 comments

still im tried for android first time and its not worked.

Worked for me with banners (RN 0.39, Android 6.0.1, on device). I did modify MainActivity to initialize the SDK:

import com.google.android.gms.ads.MobileAds;

public class MainActivity extends ReactActivity {

    ...

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MobileAds.initialize(getApplicationContext(), "ca-app-pub-your-app-id");
    }   
}

i have just tried RN 0.30 0.35 and 0.39 . but after added the package (Example android code used)
my app closed unexpectedly... is there someone recently used package?

interstial ads working but banner not work.i will try @mp31415 idea

i tried @mp31415 idea but i couldn't succeeded.. i will try only interstitial to see the result. thx...

IOS: Same here, not working with 0.38 or 0.39, only with 0.37.
https://github.com/adeelraza/react-native-admob fork working, but pressing on the ad does nothing.

got it working on Android using RN 0.39.2. I've modified MainApplication.java to add the required dependency:

import com.sbugert.rnadmob.RNAdMobPackage;

public class MainApplication extends Application implements ReactApplication {

    ...

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
      new RNAdMobPackage()
      );
    }
}

It also works on iOS, but pressing the banner in simulator does nothing, not sure how it behaves on a device. I'm using 'EMULATOR' testDeviceID so this may be the case

IOS: Same issue, on 0.37 the package works fine but when i switch to 0.39 it stop working.

screen shot 2017-01-05 at 3 26 05 pm

@danyleo You can fork the library and mitigate breaking changes yourself, until author has the time to fix it. https://github.com/facebook/react-native/wiki/Breaking-Changes#namespace-all-header-imports-to-react-e1577d---javache

@meznaric PR welcome 馃憤

Closed by #95

Was this page helpful?
0 / 5 - 0 ratings

Related issues

furkancelik picture furkancelik  路  5Comments

xencodes picture xencodes  路  5Comments

kanekotic picture kanekotic  路  6Comments

talaikis picture talaikis  路  3Comments

lydongray picture lydongray  路  4Comments