Will it be updated ?
or we can update it somewhere inside native-modules ?
Help !

I need to know about this too !
I just started using this lib, and this is popping up for me as well.
All,
I've fixed this issue on my environment.
Re-build and reload.
Note, I am not using PublisherBanner but if you do, then you also have to change it in RNPublisherBanner.js, line 31
I wish we could get this merged into master
I completely ditched off this library and used from firebase & saved my life :) :)
I completely ditched off this library and used from firebase & saved my life :) :)
can you till me how?
@baselbj it's simple uninstall react-native-admob and following the instruction to use firebase admob.
@octopusbaba I am now using firebase admob. for me I prefer simple library but unfortunately this library has many issues
I use PublisherBanner and the @flagman5 works for me. Thanks :)
loadBanner() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this._bannerView),
//UIManager.RNDFPBannerView.Commands.loadBanner, **<== Comment or replace this line**
UIManager.getViewManagerConfig('RNDFPBannerView').Commands.loadBanner, **<== Add this line**
null,
);
}
I just copied the RNAdMobBanner.js to an Overrides folder in my src/ and dus did
import AdMobBanner from "../Overrides/RNAdMobBanner";
in stead of import {AdMobBanner} from "react-native-admob";
Code can be found here:
(I just changed the line 30 code @flagman5 suggested and changed import { createErrorFromErrorData } from './utils;
to
import { createErrorFromErrorData } from 'react-native-admob/utils';
New RNAdMobBanner.js:
``` import React, { Component } from 'react';
import {
requireNativeComponent,
UIManager,
findNodeHandle,
ViewPropTypes,
} from 'react-native';
import { string, func, arrayOf } from 'prop-types';
import { createErrorFromErrorData } from 'react-native-admob/utils';
class AdMobBanner extends Component {
constructor() {
super();
this.handleSizeChange = this.handleSizeChange.bind(this);
this.handleAdFailedToLoad = this.handleAdFailedToLoad.bind(this);
this.state = {
style: {},
};
}
componentDidMount() {
this.loadBanner();
}
loadBanner() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this._bannerView),
UIManager.getViewManagerConfig('RNGADBannerView').Commands.loadBanner,
null,
);
}
handleSizeChange(event) {
const { height, width } = event.nativeEvent;
this.setState({ style: { width, height } });
if (this.props.onSizeChange) {
this.props.onSizeChange({ width, height });
}
}
handleAdFailedToLoad(event) {
if (this.props.onAdFailedToLoad) {
this.props.onAdFailedToLoad(createErrorFromErrorData(event.nativeEvent.error));
}
}
render() {
return (
style={[this.props.style, this.state.style]}
onSizeChange={this.handleSizeChange}
onAdFailedToLoad={this.handleAdFailedToLoad}
ref={el => (this._bannerView = el)}
/>
);
}
}
AdMobBanner.simulatorId = 'SIMULATOR';
AdMobBanner.propTypes = {
...ViewPropTypes,
/**
/**
/**
/**
onAdLoaded: func,
onAdFailedToLoad: func,
onAdOpened: func,
onAdClosed: func,
onAdLeftApplication: func,
};
const RNGADBannerView = requireNativeComponent('RNGADBannerView', AdMobBanner);
export default AdMobBanner;
```
Most helpful comment
All,
I've fixed this issue on my environment.
Re-build and reload.
Note, I am not using PublisherBanner but if you do, then you also have to change it in RNPublisherBanner.js, line 31