Rewarded interstitialis a type
of incentivized ad format that allows you offer rewards for ads that appear
automatically during natural app transitions. Unlike rewarded ads, users aren't
required to opt-in to view a rewarded interstitial.
The primary steps to integrate rewarded interstitial ads are as follows:
Load an ad
[Optional] Validate SSV callbacks
Register for callbacks
Display the ad and handle the reward event
Load an ad
Loading an ad is accomplished using theload(adUnitID:request)method on theGADRewardedInterstitialAdclass.
Swift
funcloadAdManagerRewardedInterstitialAd()async{do{rewardedInterstitialAd=tryawaitRewardedInterstitialAd.load(// Replace this ad unit ID with your own ad unit ID.with:"adUnitID",request:AdManagerRequest())rewardedInterstitialAd?.fullScreenContentDelegate=self}catch{print("Rewarded ad failed to load with error:\(error.localizedDescription)")}}
importGoogleMobileAdsclassRewardedInterstitialViewModel:NSObject,ObservableObject,FullScreenContentDelegate{@Publishedvarcoins=0privatevarrewardedInterstitialAd:RewardedInterstitialAd?funcloadAd()async{do{rewardedInterstitialAd=tryawaitRewardedInterstitialAd.load(with:"ca-app-pub-3940256099942544/6978759866",request:Request())rewardedInterstitialAd?.fullScreenContentDelegate=self}catch{print("Failed to load rewarded interstitial ad with error:\(error.localizedDescription)")}}
-(void)loadAdManagerRewardedInterstitialAd{[GADRewardedInterstitialAdloadWithAdUnitID:"adUnitID"request:[GAMRequestrequest]completionHandler:^(GADRewardedInterstitialAd*ad,NSError*error){if(error){NSLog(@"Failed to load rewarded interstitial ad with error: %@",error.localizedDescription);return;}self.rewardedInterstitialAd=ad;self.rewardedInterstitialAd.fullScreenContentDelegate=self;}];}
Apps that require extra data inserver-side
verificationcallbacks should use the
custom data feature of rewarded ads. Any string value set on a rewarded ad
object is passed to thecustom_dataquery parameter of the SSV callback. If no
custom data value is set, thecustom_dataquery parameter value won't be
present in the SSV callback.
The following code sample demonstrates how to set custom data on a rewarded
interstitial ad object before requesting an ad.
Swift
privatefuncvalidateAdManagerServerSideVerification()async{do{rewardedInterstitialAd=tryawaitRewardedInterstitialAd.load(// Replace this ad unit ID with your own ad unit ID.with:"adUnitID",request:AdManagerRequest())letoptions=ServerSideVerificationOptions()options.customRewardText=""SAMPLE_CUSTOM_DATA_STRING""rewardedInterstitialAd?.serverSideVerificationOptions=options}catch{print("Rewarded ad failed to load with error:\(error.localizedDescription)")}}
-(void)validateAdManagerServerSideVerification{// Replace this ad unit ID with your own ad unit ID.[GADRewardedInterstitialAdloadWithAdUnitID:"adUnitID"request:[GAMRequestrequest]completionHandler:^(GADRewardedInterstitialAd*ad,NSError*error){if(error){NSLog(@"Rewarded interstitial ad failed to load with error: %@",error.localizedDescription);return;}self.rewardedInterstitialAd=ad;GADServerSideVerificationOptions*options=[[GADServerSideVerificationOptionsalloc]init];options.customRewardString=@""SAMPLE_CUSTOM_DATA_STRING"";ad.serverSideVerificationOptions=options;}];}
ReplaceSAMPLE_CUSTOM_DATA_STRINGwith your custom data.
Register for callbacks
To receive notifications for presentation events, you must assign theGADFullScreenContentDelegateto thefullScreenContentDelegateproperty of
the returned ad:
TheGADFullScreenContentDelegateprotocol handles callbacks for when the ad
presents successfully or unsuccessfully, and when it is dismissed. The following
code shows how to implement the protocol and assign it to the ad:
Swift
funcadDidRecordImpression(_ad:FullScreenPresentingAd){print("\(#function)called.")}funcadDidRecordClick(_ad:FullScreenPresentingAd){print("\(#function)called.")}funcadWillPresentFullScreenContent(_ad:FullScreenPresentingAd){print("\(#function)called.")}funcadWillDismissFullScreenContent(_ad:FullScreenPresentingAd){print("\(#function)called.")}funcadDidDismissFullScreenContent(_ad:FullScreenPresentingAd){print("\(#function)called.")// Clear the rewarded interstitial ad.rewardedInterstitialAd=nil}funcad(_ad:FullScreenPresentingAd,didFailToPresentFullScreenContentWithErrorerror:Error){print("\(#function)called with error:\(error.localizedDescription).")}
-(void)adDidRecordImpression:(id<GADFullScreenPresentingAd>)ad{NSLog(@"%s called",__PRETTY_FUNCTION__);}-(void)adDidRecordClick:(id<GADFullScreenPresentingAd>)ad{NSLog(@"%s called",__PRETTY_FUNCTION__);}-(void)adWillPresentFullScreenContent:(id<GADFullScreenPresentingAd>)ad{NSLog(@"%s called",__PRETTY_FUNCTION__);}-(void)adWillDismissFullScreenContent:(id<GADFullScreenPresentingAd>)ad{NSLog(@"%s called",__PRETTY_FUNCTION__);}-(void)adDidDismissFullScreenContent:(id<GADFullScreenPresentingAd>)ad{NSLog(@"%s called",__PRETTY_FUNCTION__);// Clear the rewarded interstitial ad.self.rewardedInterstitialAd=nil;}-(void)ad:(id)addidFailToPresentFullScreenContentWithError:(NSError*)error{NSLog(@"%s called with error: %@",__PRETTY_FUNCTION__,error.localizedDescription);}
When presenting your ad, you must provide aGADUserDidEarnRewardHandlerobject
to handle the reward for the user.
The following code presents the best method for displaying a rewarded
interstitial ad.
Swift
funcshowRewardedInterstitialAd(){guardletrewardedInterstitialAd=rewardedInterstitialAdelse{returnprint("Ad wasn't ready.")}// The UIViewController parameter is an optional.rewardedInterstitialAd.present(from:nil){letreward=rewardedInterstitialAd.adRewardprint("Reward received with currency\(reward.amount), amount\(reward.amount.doubleValue)")// TODO: Reward the user.}}
-(void)showRewardedInterstitialAd{[self.rewardedInterstitialAdpresentFromRootViewController:selfuserDidEarnRewardHandler:^{GADAdReward*reward=self.rewardedInterstitialAd.adReward;NSString*rewardMessage=[NSStringstringWithFormat:@"Reward received with "@"currency %@ , amount %ld",reward.type,[reward.amountlongValue]];NSLog(@"%@",rewardMessage);// TODO: Reward the user.}];}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADCustomEventNativeAdDelegate\u003c/code\u003e is deprecated and developers should use \u003ccode\u003eGADMediationNativeAdEventDelegate\u003c/code\u003e instead.\u003c/p\u003e\n"],["\u003cp\u003eThis protocol facilitated communication between native ad's custom events and the Google Mobile Ads SDK.\u003c/p\u003e\n"],["\u003cp\u003eIt included methods to signal ad load failures (\u003ccode\u003ecustomEventNativeAd:didFailToLoadWithError:\u003c/code\u003e) and successful loads of unified native ads (\u003ccode\u003ecustomEventNativeAd:didReceiveMediatedUnifiedNativeAd:\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eBoth aforementioned methods are now deprecated in favor of the newer delegate.\u003c/p\u003e\n"]]],[],null,[]]