LevelPlay Listener with Ad Info Integration

As part of ironSource SDK 7.2.3, you’ll be able to receive more data in ad callbacks, including network, segment, and A/B indication.

Implement the new ad unit listeners

Implement the new LevelPlay listeners, that support AdInfo callback.

The AdInfo represents the last ad that was loaded successfully, and is not included in Load Fail callbacks, as there’s no available ad.

We recommend you to unregister from the old listeners, to avoid data duplications.

Rewarded Video

+ (void)setLevelPlayRewardedVideoDelegate:(nullable id<LevelPlayRewardedVideoDelegate>)delegate;

#pragma mark - LevelPlayRewardedVideoDelegate
/**
 Called after a rewarded video has changed its availability to true.
 @param adInfo The info of the ad.
 Replaces the delegate rewardedVideoHasChangedAvailability:(true)available 
 */
- (void)hasAdAvailableWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has changed its availability to false.
 Replaces the delegate rewardedVideoHasChangedAvailability:(false)available 
 */
- (void)hasNoAvailableAd{
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo {
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo {
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */
- (void)didClick:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}

Note: When updating your listener implementation from ISRewardedVideoDelegate to LevelPlayRewardedVideoDelegate, use the callbacks hasAdAvailableWithAdInfo and hasNoAvailableAd, instead of using rewardedVideoHasChangedAvailability.

Rewarded Video Manual Load

+ (void)setLevelPlayRewardedVideoManualDelegate:(nullable id<LevelPlayRewardedVideoManualDelegate>)delegate;

#pragma mark - LevelPlayRewardedVideoManualDelegate
/**
 Called after an rewarded video has been loaded in manual mode
 @param adInfo The info of the ad.
 */
- (void)didLoadWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has attempted to load but failed in manual mode
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}

/**
 Called after a rewarded video has been viewed completely and the user is eligible for a reward.
 @param placementInfo An object that contains the placement's reward name and amount.
 @param adInfo The info of the ad.
 */
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been opened.
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a rewarded video has been clicked. 
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build
 @param adInfo The info of the ad.
 */
- (void)didClick:(ISPlacementInfo *)placementInfo withAdInfo:(ISAdInfo *)adInfo{
}

Interstitial

+ (void)setLevelPlayInterstitialDelegate:(nullable id<LevelPlayInterstitialDelegate>)delegate;

#pragma mark - LevelPlayInterstitialDelegate
/**
 Called after an interstitial has been loaded
 @param adInfo The info of the ad.
 */
- (void)didLoadWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has attempted to load but failed.
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}
/**
 Called after an interstitial has been opened. 
 This is the indication for impression. 
 @param adInfo The info of the ad.
 */
- (void)didOpenWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didCloseWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has attempted to show but failed.
 @param error The reason for the error
 @param adInfo The info of the ad.
 */
- (void)didFailToShowWithError:(NSError *)error andAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been clicked.
 @param adInfo The info of the ad.
 */
- (void)didClickWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after an interstitial has been displayed on the screen.
 This callback is not supported by all networks, and we recommend using it 
 only if it's supported by all networks you included in your build. 
 @param adInfo The info of the ad.
 */
- (void)didShowWithAdInfo:(ISAdInfo *)adInfo{
}

+ (void)setLevelPlayBannerDelegate:(nullable id<LevelPlayBannerDelegate>)delegate;

#pragma mark - LevelPlayBannerDelegate
/**
 Called after each banner ad has been successfully loaded, either a manual load or banner refresh
 @param adInfo The info of the ad.
 */
- (void)didLoad:(ISBannerView *)bannerView withAdInfo:(ISAdInfo *)adInfo{
}

/**
 Called after a banner has attempted to load an ad but failed. 
 This delegate will be sent both for manual load and refreshed banner failures. 
 @param error The reason for the error
 */
- (void)didFailToLoadWithError:(NSError *)error{
}
/**
 Called after a banner has been clicked.
 @param adInfo The info of the ad.
 */
- (void)didClickWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called when a user was taken out of the application context.
 @param adInfo The info of the ad.
 */
- (void)didLeaveApplicationWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called when a banner presented a full screen content.
 @param adInfo The info of the ad.
 */
- (void)didPresentScreenWithAdInfo:(ISAdInfo *)adInfo{
}
/**
 Called after a full screen content has been dismissed.
 @param adInfo The info of the ad.
 */
- (void)didDismissScreenWithAdInfo:(ISAdInfo *)adInfo{
}

Note: The delegates didLoad and didFailToLoadWithError will be sent both for manual load and refreshed banners.

Integrate the AdInfo data

Once you implement the LevelPlay Listeners with AdInfo, you’ll be able to use the data as part of your app’s data.

If the AdInfo data is not available, the adInfo string params will return an empty string, and the numeric params will return 0 value.

(void)didLoadWithAdInfo:(ISAdInfo *)adInfo {
   NSString *auction_id = adInfo.auction_id;
   NSString *ad_unit = adInfo.ad_unit;
   NSString *ad_network = adInfo.ad_network;
   NSString *instance_name = adInfo.instance_name;
   NSString *instance_id = adInfo.instance_id;
   NSString *country = adInfo.country;
   NSNumber *revenue = adInfo.revenue;
   NSString *precision = adInfo.precision;
   NSString *ab = adInfo.ab;
   NSString *segment_name = adInfo.segment_name;
   NSString *encrypted_cpm = adInfo.encrypted_cpm;
}

Ad Info fields

Here’s a list of the relevant data fields, including description and type that are being returned as part of the new AdInfo object:

Parameter Name Description Data Type
auctionId Unique identifier for the auction String
adUnit The ad unit displayed (Rewarded Video/Interstitial/Banner) String
adNetwork The ad network name that served the ad String
instanceName The ad network instance name as defined on the platform. For bidding sources, the instance name will be ‘Bidding’ String
instanceId Identifier per network, this includes the ad network’s
instanceID/placement/zone/etc.
String
country Country code ISO 3166-1 format String
revenue The revenue generated for the impression (USD). The revenue value is either estimated or exact, according to the precision (see precision field description) Double
precision The source value of the revenue field:
BID – The revenue provided as part of the real-time auction (Not supported by FAN bidders)
RATE – manual price the publisher assigned to an instance in the ironSource platform
CPM – Calculation based on historical instance performance, performed by ironSource platform
String
ab Indication if A/B test was activated via ironSource platform String
segmentName The segment the user is related to as defined based on the segmentation method String
encryptedCPM Relevant for ads provided by Meta Audience Network only, and will be reported to publishers approved by Meta Audience Network within the closed beta String