S2S Rewarded Callbacks
This guide covers cases where media server verification is available when using S2S rewarded ads.
Check if the Ad Supports Server Verification
You can check this using GFPRewardedAdManager's isAdServerVerificationEnabled property.
The correct value is set after the ad has been loaded.
- Objective-C
@property (nonatomic, readonly, assign) BOOL isAdServerVerificationEnabled;
Delegate Calls for Each Situation During Reward Server Callback
When the Server Reward Request Succeeds
If the verification from the server is successful, a response is returned via the following method of GFPRewardedAdManagerDelegate.
- Objective-C
- Swift
-(void)rewardedAdManagerDidSuccessServerRewardVerification:(GFPRewardedAdManager *)manager;
func rewardedAdManagerDidSuccessServerRewardVerification(_ manager: GFPRewardedAdManager)
When Server Reward Verification Fails
If the verification from the server fails and the reward cannot be granted, a response is returned via the following method of GFPRewardedAdManagerDelegate.
When this method is called, the verification will continue to fail even if retried, so you should handle it as a reward failure.
- Objective-C
- Swift
-(void)rewardedAdManager:(GFPRewardedAdManager *)manager didFailedServerRewardVerification:(GFPError *)error;
func rewardedAdManager(_ manager: GFPRewardedAdManager, didFailedServerRewardVerification error: NaverAdsServices.GFPError)
When an Error Occurs During Server Reward Request
If an unexpected error—such as a network issue or timeout—occurs during the verification request to the server, a response is returned via the following method of GFPRewardedAdManagerDelegate.
In this case, you should retry the request to the verification server.
- Objective-C
- Swift
-(void)rewardedAdManager:(GFPRewardedAdManager *)manager didReceiveErrorServerRewardVerification:(GFPError *)error;
func rewardedAdManager(_ manager: GFPRewardedAdManager, didReceiveErrorServerRewardVerification error: NaverAdsServices.GFPError)
Reward Request Retry APIs
GFPRewardedAdManager provides APIs for retrying and for manually closing the ad view when a retry situation occurs or upon failure.
You can implement retry logic using these APIs according to the situation. When a retry is requested, the result—whether success or failure—is delivered through the same delegate methods described above.
requestServerVerification
Requests a retry of server verification.
- Swift
- Objective-C
self.adManager?.requestServerVerification()
[self.adManager requestServerVerification];
close
Forcibly closes the S2S ad. This close option is provided exclusively for S2S ads.
- Swift
- Objective-C
self.adManager?.close()
[self.adManager close];