Skip to content

Native Ads API

CMAdSDK edited this page May 19, 2016 · 29 revisions

The main APIs for the Native Ad

The SDK Base Version APIs of the Native Ad are a little different from the SDK Ext Version.

####SDK Base Version API The API for SDK Base Version :

  • com.cmcm.adsdk.nativead.NativeAdManagerMini

    Methodology Method Introduction
    NativeAdManagerMini(Context context, String posid) NativaAdManagerMini construct function
    setNativeAdListener(INativeAdLoaderListener listener) set callback interface
    loadAd( ) concurrent load ads
    preloadAd( ) sequence load ads
    getAd( ) get ads
  • com.cmcm.baseapi.ads.INativeAd

    Methodology Method Introduction
    getAdtitle() ad title
    getAdBody() ad description
    getAdIconUrl() ad icon url
    getAdCoverImageUrl() ad background picture Url
    getAdCallToAction() ad button text
    getAdStarRating() ad star score(can be null)
    getAdSocialContext() ad download amount or website(can be null)
    hasExpired() check ad expired(true mean expired)
    isDownLoadApp() check download type app (true: yes false: no null: no information
    setImpressionListener(ImpressionListener listener) set callback after SDK ad impression report
    registerViewForInteraction(View view) bundle ad view with ad itself(requested)
    unregisterView() unbundling ad view with ad itself(requested)

####SDK Ext Version API The API for SDK Ext Version :

  • com.cmcm.adsdk.nativead.NativeAdManagerEx

    Methodology Method Introduction
    NativeAdManagerEx(Context context, String posid) NativaAdManagerEx construct function
    setNativeAdListener(INativeAdLoaderListener listener) set callback interface
    loadAd( ) concurrent load ads
    preloadAd( ) sequence load ads
    getAd( ) get ads
  • com.cmcm.baseapi.ads.INativeAd

    Methodology Method Introduction
    getAdtitle() ad title
    getAdBody() ad description
    getAdIconUrl() ad icon url
    getAdCoverImageUrl() ad background picture Url
    getAdCallToAction() ad button text
    getAdStarRating() ad star score(can be null)
    getAdSocialContext() ad download amount or website(can be null)
    hasExpired() check ad expired(true mean expired)
    isDownLoadApp() check download type app (true: yes false: no null: no information
    setImpressionListener(ImpressionListener listener) set callback after SDK ad impression report
    registerViewForInteraction(View view) bundle ad view with ad itself(requested)
    unregisterView() unbundling ad view with ad itself(requested)

Clone this wiki locally