private NativeAd ad;
private void initAd()
{
// Create an instance of NativeAd
ad = new NativeAd(YOUR_SLOT_ID, this);
// Get an instance of CustomParams
CustomParams customParams = ad.getCustomParams();
// Set the age
customParams.setAge(25);
// Set the gender
customParams.setGender(CustomParams.Gender.MALE);
}
@interface YourViewController : UIViewController
@end
@implementation YourViewController
{
MTRGNativeAd *_ad;
}
- (void)initAd
{
// Create an instance of MTRGNativePromoAd
_ad = [MTRGNativeAd nativeAdWithSlotId:YOUR_SLOT_ID];
// Set the age
_ad.customParams.age = [NSNumber numberWithInt:25];
// Set the gender
_ad.customParams.gender = MTRGGenderMale;
}
private MyTargetView _myTargetView;
private void InitAd()
{
// Create an instance of MyTargetView
_myTargetView = new MyTargetView(YOUR_SLOT_ID);
// Set the age
_myTargetView.CustomParams.Age = 23;
// Set the gender
_myTargetView.CustomParams.Gender = CustomParams.GenderEnum.Male;
}