Open Stalder opened 7 years ago
Tried to migrate to react-native-admob 2.0.0-beta.2, the same issue. + now doesn't work eventListener which subscribed to adClosed
componentDidMount(){
const { dispatch } = this.props;
AdMobInterstitial.addEventListener('adClosed', () => {
console.log('CLOSED');
dispatch(actionCreators.setPage({name: 'Hello'}));
});
AdMobInterstitial.requestAd(error => {
AdMobInterstitial.showAd((error) => {});
});
}
Did you resolve the issue? My app is also brought to the background right after the interstitial ad is closed. I initiate it only once in ComponentDidMount of the main component and the ad is requested and shown with this.
AdMobInterstitial.requestAd(() => { AdMobInterstitial.showAd(); });
@pixochi your comment made me understand what this issue is about, thanks! Will see if there’s something to do.
@koenpunt I was using it inside Expo when this happened, now I built a standalone android app and the problem is gone. Sorry, I didn't mention expo before, but I didn't realize it would make a difference.
It works great on Android emulator and IOS, but if i try to close interstitial on android device, app is closing and works in background. If i resume app, it still works great
RN 0.49 expo 21 react-native-admob 1.3.2
There is a snippet:
Full test project is here: https://github.com/Stalder/AdMobTest Expo project: https://exp.host/@stalder/flatlist-test