Last active
June 6, 2021 05:21
-
-
Save LuffyAnshul/afb4594b2700ba5d61bb918c120db280 to your computer and use it in GitHub Desktop.
Interstitial ADs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { InterstitialAd, TestIds, AdEventType} from '@react-native-firebase/admob'; | |
... | |
showInterstitialAd = () => { | |
// Create a new instance | |
const interstitialAd = InterstitialAd.createForAdRequest(TestIds.INTERSTITIAL); | |
// Add event handlers | |
interstitialAd.onAdEvent((type, error) => { | |
if (type === AdEventType.LOADED) { | |
interstitialAd.show(); | |
} | |
}); | |
// Load a new advert | |
interstitialAd.load(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment