mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-24 04:24:52 +08:00
[admob][ios] Fix an issue whereby interstitials on iOS could not be reused with the same adUnit ID
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user