To retrieve the Ad Review creative identifier, implement the creative ID callback as shown below:
public class ExampleScene: MonoBehaviour
{
void Start()
{
// Interstitial ads
MaxSdkCallbacks.Interstitial.OnAdReviewCreativeIdGeneratedEvent += OnInterstitialAdReviewCreativeIdGeneratedEvent;
// Rewarded ads
MaxSdkCallbacks.Rewarded.OnAdReviewCreativeIdGeneratedEvent += OnRewardedAdReviewCreativeIdGeneratedEvent;
// Banner ads
MaxSdkCallbacks.Banner.OnAdReviewCreativeIdGeneratedEvent += OnBannerAdReviewCreativeIdGeneratedEvent;
// MREC ads
MaxSdkCallbacks.MRec.OnAdReviewCreativeIdGeneratedEvent += OnMRecAdReviewCreativeIdGeneratedEvent;
}
// Interstitial ads
private void OnInterstitialAdReviewCreativeIdGeneratedEvent(string adUnitId, string adReviewCreativeId, MaxSdkBase.AdInfo adInfo)
{
Debug.Log("Interstitial ad review creative ID: " + adReviewCreativeId);
}
// Rewarded ads
private void OnRewardedAdReviewCreativeIdGeneratedEvent(string adUnitId, string adReviewCreativeId, MaxSdkBase.AdInfo adInfo)
{
Debug.Log("Rewarded ad review creative ID: " + adReviewCreativeId);
}
// Banner ads
private void OnBannerAdReviewCreativeIdGeneratedEvent(string adUnitId, string adReviewCreativeId, MaxSdkBase.AdInfo adInfo)
{
Debug.Log("Banner ad review creative ID: " + adReviewCreativeId);
}
// MREC ads
private void OnMRecAdReviewCreativeIdGeneratedEvent(string adUnitId, string adReviewCreativeId, MaxSdkBase.AdInfo adInfo)
{
Debug.Log("MRec ad review creative ID: " + adReviewCreativeId);
}
}public class ExampleActivity
extends Activity
implements MaxAdReviewListener
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
exampleAd.setAdReviewListener( this );
super.onCreate( savedInstanceState );
}
// Ad methods
@Override
public void onCreativeIdGenerated(final String creativeId, final MaxAd ad)
{
System.out.println( "Ad Creative ID generated: " + creativeId );
}
}class ExampleActivity : Activity(), MaxAdReviewListener
{
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate( savedInstanceState )
exampleAd.setAdReviewListener( this )
}
// Ad methods
override fun onCreativeIdGenerated(creativeId: String?, ad: MaxAd?)
{
println( "Ad Creative ID generated: " + creativeId )
}
}@interface ExampleViewController()<MAAdReviewDelegate>
@end
@implementation ExampleViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.exampleAd.adReviewDelegate = self;
}
// Ad methods
- (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad
{
NSLog(@"Ad Creative ID generated: %@", creativeIdentifier);
}
@end
class ExampleViewController: UIViewController, MAAdReviewDelegate
{
override func viewDidLoad()
{
super.viewDidLoad()
exampleAd.adReviewDelegate = self
}
// Ad methods
func didGenerateCreativeIdentifier(_ creativeIdentifier: String, for ad: MAAd)
{
print("Ad Creative ID generated: \(creativeIdentifier)")
}
}