Mintegral

Mintegral

사용방법

1) 설치

미디에이션

2) 초기화

-> 링크 (해당 링크는 Mintegral 로그인을 해야 확인할 수 있습니다.)



- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [self setupMintegral];
    return YES;
}


-(void)setupMintegral {
    MTGSDK *sdk = [MTGSDK sharedInstance];
    [sdk setAppID:@"your appID" ApiKey:@"your appKey"];
}

Native Layout 설정

스토리보드에 UIView 생성 후 Custom Class을 AdPopcornSSPNativeAd 설정

AdPopcornSSPNativeAd 영역 안에 미디에이션 업체의 실제 광고 영역 추가 및 viewcontroller에 outlet 연결합니다.

storyboard에서 생성한 UI view를 APMintegralNativeAdRenderer 를 사용하여 sdk에 전달한다.

#import <AdPopcornSSP/AdPopcornSSPNativeAd.h>	
#import "Mintegral.h"

- (void)viewDidLoad {
  [super viewDidLoad];
  // Do any additional setup after loading the view.
  APMintegralNativeAdRenderer *apMintegralNativeAdRenderer = [[APMintegralNativeAdRenderer alloc] init];
  apMintegralNativeAdRenderer.adUIView = _mintegralNativeAdView;
  apMintegralNativeAdRenderer.iconImageView = _mintegralAdIconView;
  apMintegralNativeAdRenderer.appNameLabel = _mintegralAdTitleView;
  apMintegralNativeAdRenderer.appDescLabel = _mintegralAdDescView;
  apMintegralNativeAdRenderer.adCallButton = _mintegralAdCTAView;
  apMintegralNativeAdRenderer.mMediaView = _mintegralMediaView;
  [_adPopcornSSPNativeAd setMintegralNativeRenderer:apMintegralNativeAdRenderer superView:_mintegralNativeAdView];
}

APMintegralNativeAdRenderer 를 생성한 뒤, 애드팝콘 Mintegral 네이티브 광고에서 지원하는 title, desc, icon, cta, mediaView를 전달하여 준다. 단, 이 5개의 component들은 하나의 UIView 영역 안에 포함되어 있어야 하며, 해당 superview는 adUIView 에 반드시 전달해 주어야 합니다.

APMintegralNativeAdRenderer에 각 component를 연결시켜 준 후, 아래 API를 통해서, setMintegralNativeRenderer:superView: API를 통해 render와 namNativeAdView 를 sdk에 최종적으로 전달합니다.

Last updated

Was this helpful?