iOS 旧版ADMobGen升级ADSuyi向导

简介

本文档旨在帮助已接入iOS ADMobGen 1.4.* 版本开发者快速升级到3.0 以上版本ADSuyi SDK指南。

1 移除ADMobGenSDK

手动导入的ADMobGenSDK:

在项目的文件列表中搜索ADMob,将所有ADMobGen及ADMobile开头的framework移除。

pod导入的ADMobGenSDK:

在项目的Podfile文件中搜索ADMob,将所有ADMobGen及ADMobile开头的代码移除,再执行pod install命令。

2 项目代码调整

1、 ADMobGen相关类更换为ADSuyi相关类

<ADMobGenSDK/ADMobGenSDKConfig.h>       更换为 <ADSuyiSDK/ADSuyiSDK.h>
<ADMobGenSDK/ADMobGenSplashAd.h>        更换为 <ADSuyiSDK/ADSuyiSDKSplashAd.h>
<ADMobGenSDK/ADMobGenNativeExpressAd.h> 更换为 <ADSuyiSDK/ADSuyiSDKNativeAd.h>
<ADMobGenSDK/ADMobGenUnifiedNativeAd>     更换为 <ADSuyiSDK/ADSuyiSDKNativeAd.h>
<ADMobGenSDK/ADMobGenBannerView.h>      更换为 <ADSuyiSDK/ADSuyiSDKBannerAdView.h>
<ADMobGenSDK/ADMobGenInterstitialAd.h>  更换为 <ADSuyiSDK/ADSuyiSDKIntertitialAd.h>
<ADMobGenSDK/ADMobGenRewardvodAd.h>     更换为 <ADSuyiSDK/ADSuyiSDKRewardvodAd.h>
去除<ADMobGenAdapter/ADMobGenNativeExpressAdView.h>类


2、 SDK初始化修改

(1)<ADMobGenSDK/ADMobGenSDKConfig.h>更换为 <ADSuyiSDK/ADSuyiSDK.h>
(2)暂时删除setGpsOn方法,如有使用到[ADMobGenSDKConfig setGpsOn],请删除;
(3)枚举类型ADMobGenLogLevel修改为ADSuyiKitLogLevel,使用需要导入#import <ADSuyiKit/ADSuyiKitLogging.h>;
(4)删除setDebugMode方法,如有使用到请删除;


3、开屏广告修改

苏伊士广告OC请求开屏代码示例:[开屏代码示例]

苏伊士广告Swift请求开屏代码示例:[开屏代码示例]

(1)<ADMobGenSDK/ADMobGenSplashAd.h>更换为<ADSuyiSDK/ADSuyiSDKSplashAd.h>;
(2)ADMobGenSplashAdDelegate代理更换为ADSuyiSDKSplashAdDelegate代理;
(3)苏伊士开屏ADSuyiSDKSplashAd新增参数posId,广告位id,必需,否则请求失败;
(4)苏伊士开屏ADSuyiSDKSplashAd新增参数tolerateTimeout,开屏请求超时时间,非必需,默认为4s;
(5)苏伊士开屏ADSuyiSDKSplashAd新增参数controller,用来弹出目标页的ViewController,必需;


4、横幅广告修改

苏伊士广告OC请求横幅代码示例:[横幅代码示例]

苏伊士广告Swift请求横幅代码示例:[横幅代码示例]

(1)<ADMobGenSDK/ADMobGenBannerView.h>更换为<ADSuyiSDK/ADSuyiSDKBannerAdView.h>;
(2)ADMobGenBannerViewDelegate代理更换为ADSuyiSDKBannerAdViewDelegate代理;
(3)苏伊士横幅ADSuyiSDKBannerAdView初始化只保留initWithFrame方法;
(4)苏伊士横幅ADSuyiSDKBannerAdView新增参数posId,广告位id,必需,否则请求失败;
(5)苏伊士横幅ADSuyiSDKBannerAdView新增参数tolerateTimeout,开屏请求超时时间,非必需,默认为4s;
(6)苏伊士横幅ADSuyiSDKBannerAdView新增参数refershTime,刷新时间间隔需30-120s之间,非必需,默认不刷新;
(7)去除closeButtonHidden方法,如有使用请删除;


5、信息流广告修改(自渲染和模板都统一修改为信息流)

苏伊士广告OC请求信息流广告代码示例:[信息流广告代码示例]

苏伊士广告Swift请求信息流广告代码示例:[信息流广告代码示例]

(1)<ADMobGenSDK/ADMobGenNativeExpressAd.h>更换为<ADSuyiSDK/ADSuyiSDKNativeAd.h>;
(2)<ADMobGenSDK/ADMobGenUnifiedNativeAd>更换为<ADSuyiSDK/ADSuyiSDKNativeAd.h>;
(3)ADMobGenNativeExpressAdDelegate和ADMobGenUnifiedNativeAdDelegate代理更换为ADSuyiSDKNativeAdDelegate代理;
(4)苏伊士信息流ADSuyiSDKNativeAd的初始化方法只保留initWithAdSize;
(5)苏伊士信息流ADSuyiSDKNativeAd新增参数posId,广告位id,必需,否则请求失败;
(6)苏伊士信息流ADSuyiSDKNativeAd新增参数tolerateTimeout,开屏请求超时时间,非必需,默认为4s;
(7)苏伊士信息流ADSuyiSDKNativeAd新增参数status,当前加载状态,用于频繁请求信息流广告的场景;
(8)去除closeButtonHidden方法,如有使用请删除;
(9)去除setNativeAdType方法,如有使用请删除;
(10)去除setBuNativeExpressType方法,如有使用请删除;
(11)‘admg_nativeExpressAdSucessToLoad:views:’代理更换为‘adsy_nativeAdSucessToLoad:adViewArray:‘;
(11)ADMobGenNativeExpressAdView类更换为遵守ADSuyiAdapterNativeAdViewDelegate协议的UIView,即UIView<ADSuyiAdapterNativeAdViewDelegate>;
(12)ADMobGenNativeExpressAdView类的render方法更换为ADSuyiAdapterNativeAdViewDelegate中的adsy_registViews方法;
(13)如果ADSuyiAdapterNativeAdViewDelegate中的
renderType为ADSuyiAdapterRenderTypeExpress,则信息流广告为信息流模板视图
renderType为ADSuyiAdapterRenderTypeNative,则信息流广告为信息流自渲染,需要自行组合;
(14)删除ADMobGenNativeExpressAdView类中的contentSize方法,如有使用请删除;


6、激励视频广告修改

苏伊士广告OC请求激励视频代码示例:[激励视频广告代码示例]

苏伊士广告Swift请求激励视频代码示例:[激励视频广告代码示例]

(1)<ADMobGenSDK/ADMobGenRewardvodAd.h>更换为<ADSuyiSDK/ADSuyiSDKRewardvodAd.h>;
(2)ADMobGenRewardvodAdDelegate代理更换为ADSuyiSDKRewardvodAdDelegate代理;
(3)苏伊士激励视频ADSuyiSDKRewardvodAd新增参数posId,广告位id,必需,否则请求失败;
(4)苏伊士激励视频ADSuyiSDKRewardvodAd新增参数tolerateTimeout,开屏请求超时时间,非必需,默认为4s;
(5)loadVideoAd和loadVideoAdIndex更换为loadRewardvodAd,如有使用请替换;
(6)删除setBuRewardvodType方法,如有使用请删除;


7、插屏广告修改

苏伊士广告OC请求插屏广告代码示例:[插屏广告代码示例]

苏伊士广告Swift请求插屏广告代码示例:[插屏广告代码示例]

(1)<ADMobGenSDK/ADMobGenInterstitialAd.h>更换为<ADSuyiSDK/ADSuyiSDKIntertitialAd.h>;
(2)ADMobGenInterstitialAdDelegate代理更换为ADSuyiSDKIntertitialAdDelegate代理;
(3)苏伊士插屏ADSuyiSDKIntertitialAd初始化不做限制;
(4)苏伊士插屏ADSuyiSDKIntertitialAd新增参数posId,广告位id,必需,否则请求失败;
(5)苏伊士插屏ADSuyiSDKIntertitialAd新增参数tolerateTimeout,开屏请求超时时间,非必需,默认为4s;
(6)load方法更换为loadAdData,如有使用请替换;

results matching ""

    No results matching ""