[admob][ios] Fix an issue whereby interstitials on iOS could not be reused with the same adUnit ID

This commit is contained in:
Elliot Hesp
2017-07-04 15:39:56 +01:00
parent 43410bbadd
commit 92b3860230
2 changed files with 14 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { NativeModules } from 'react-native';
import { NativeModules, Platform } from 'react-native';
import { statics } from './';
import AdRequest from './AdRequest';
import { nativeToJSError } from '../../utils';
@@ -8,6 +8,11 @@ const FirebaseAdMob = NativeModules.RNFirebaseAdMob;
export default class Interstitial {
constructor(admob: Object, adUnit: string) {
// Interstitials on iOS require a new instance each time
if (Platform.OS === 'ios') {
FirebaseAdMob.clearInterstitial(adUnit);
}
this.admob = admob;
this.adUnit = adUnit;
this.loaded = false;