歆会广告SDK接入

2022-08-07  本文已影响0人  神佑沽单

项目地址https://gitee.com/shenTing/xhad-sdkdemo

1.导入必须的三方库

  #穿山甲
  pod  'Ads-CN', '~> 4.2.5.3'
  #优量汇
  pod  'GDTMobSDK'
  #百度
  pod  'BaiduMobAdSDK'
  #sigmob
  pod  'SigmobAd-iOS'
  

2. TARGETS-->Build Settings--> bitcode

截屏2022-08-08 10.21.37.png

3.导入三方framework

KSAdSDK.framework
WindFoundation.xcframework
WindSDK.xcframework
BaiduMobAdSDK.framework
截屏2022-11-02 上午11.43.13.png

4.SDK初始化

    //初始化广告
    [XHAdSDKManager initWithAppId:@"歆会广告SDK----appid"];
    //初始化开屏--(可选)
    [XHAdSDKManager initSplashWithAppId:@"开屏appid"];
    //初始化激励视频--(可选)
    [XHAdSDKManager initRewardAdWithAppId:@"激励视频appid"];
    //初始化插页--(可选)
    [XHAdSDKManager initInterAdWithAppId:@"插页appid"];
    //初始化banner--(可选)
    [XHAdSDKManager initBannerAdWithAppId:@"banner appid"];

5.开屏广告初始化

    XHAdCenter * center = [XHAdCenter new];
    XHSplashAdData * data = [XHSplashAdData new];
    data.rootViewController = self;
    data.splashDelegate = self;
    data.bottomView = self.view;
    data.timeoutInterval = 3;
    data.isSplashVideoAd = YES;
    [center xh_showSplashAd:data];

6.banner广告初始化

    XHAdCenter * center1 = [XHAdCenter new];
    XHBannerAdData * data1 = [XHBannerAdData new];
    data1.rootViewController = self;
    data1.bannerAdDelegate = self;
    data1.bottomView = bottomView1;
    data1.timeoutInterval = 3;
    data1.isSplashVideoAd = self.isSplashVideoAd;
    [center1 xh_showBannerAd:data1];

7.激励视频广告初始化

    XHAdCenter * center = [XHAdCenter new];
    self.center = center;
    XHRewardAdData * data = [XHRewardAdData new];
    data.rootViewController = self;
    data.rewardAdDelegate = self;
    [self.center xh_showRewardAd:data];

8.插屏广告初始化

    XHAdCenter * center = [XHAdCenter new];
    XHRewardAdData * data = [XHRewardAdData new];
    data.rootViewController = self;
    data.rewardAdDelegate = self;
    [center xh_showRewardAd:data];

原生广告和其他广告SDK会返回广告数据流--页面需自行绘制

上一篇下一篇

猜你喜欢

热点阅读