English
Log In
You can then view all documents
Installation/Android/Self-rendering banner
Self-rendering banner
Last updated 2022-01-19 22:08:41

Origin Rendering banner

Introduction

Self-rendering Banner:: Developers can get the material information of the advertisement for stitching

Supported ad sizes:

  • Large picture (Picture with aspect ratio: 1.78)
  • Small image (Picture with aspect ratio: 1.52)
  • Group pictures (three pictures with aspect ratio: 1.52)

Permission

Self-rendering Banner: Reclaimed and no longer available for creation

Self-rendering Banner request method

Create TTAdNative object

复制

Create ad request type parameter AdSlot

Note:
1.setImageAcceptedSize aspect ratio is set according to the ratio checked when creating the code bit ID unit px
2. When setNativeAdType requests native ads, please call this method and set the parameter to TYPE_BANNER

复制

Parameter Description

Method

Description

setCodeId()

The code bit ID created by the platform starts with 9 and 9 digits

setImageAcceptedSize()

Set the size of the requested template creative unit: px

setNativeAdType()

Request ad type

setAdCount()

The number of requested ads is 1-3

Request ads

The access party can call loadNativeAd(AdSlot adSlot, @NonNull NativeAdListener listener) to load ads asynchronously

复制

NativeAdListener

Callback

Description

onError()

The error code returned by the ad request failed callback indicates the reason for the ad request failure. For details, please see [link](https://www.pangle.cn/help/doc/5de4cc6d78c8690012a90aa5?from=ad. oceanengine.com&id=5de4cc6d78c8690012a90aa5)

onNativeAdLoad()

Callback for successful ad request

Notice:

  • Before addView, you need to call the removeAllViews method to remove all the views on the control
    -setNativeAdType(AdSlot.TYPE_INTERACTION_AD)//When requesting native ads, be sure to call this method and set the parameter to TYPE_BANNER
    -Self-rendering banner is to create a view on the FrameLayout control, add advertising elements to the view, and bind the view to the corresponding control

TTFeedAd interface description

Get advertising information, such as title, buttonText, etc., through getAdView(), and customize the entire advertising area to draw as close as possible to the style of your own application

复制

Banner advertising behavior monitoring

Note: Important! AdInteractionListener involves advertising billing, convertView must be called correctly and ViewGroup must be used

复制

AdInteractionListener

Method

Description

onAdClicked()

Click the common area callback

onAdCreativeClick()

Click on creative area callback

onAdShow()

Advertising display callback

TTAdDislike

The SDK provides information flow advertisements for the access party. When the user chooses to close the advertisement, the user will be asked in the form of a pop-up window, including the options of "Not interested" and "Have seen" for the user to choose. This feedback is mainly used for the advertising strategy of Toutiao ads on the client side, to optimize and increase the click-through rate of the ads, improve the advertising effect and the revenue of the partners

Note:
If using Dislike logic, initialize TTAdNative mTTAdNative =
When ttAdManager.createAdNative(activity), parameters must be passed into activity

Banner ad access Dislike

After obtaining TTNativeAd, call TTNativeAd.getDislikeDialog() to obtain the TTAdDislike object, and then set the user selection result callback for the object.

The following logic is the logic in the CSJ 3500 SDK. Developers of the SDK below 3500 can refer to the corresponding demo for integration:

复制
Turn off ad monitoring
DislikeInteractionCallback

Method

Description

onItemClick()

Callback when user clicks filterWord in the case of custom style

onClick()

User clicked "Why see this ad" in the case of custom styles

onSelected()

Default dislike style, click filterWord to call back. Developers can remove ads in this callback

onCancel()

The default dislike style, click to cancel the callback

onShow()

default dislike style, dislike pop-up window display back

onRefuse()

The default dislike style, the user repeatedly clicks the dislike button to call back, version 3600 is abolished

Destroy advertising objects

复制

Reference Demo

For self-rendered banner ads, please refer to the NativeBannerActivity example in Demo

Self-rendering Banner Note:

  1. The aspect ratio of setImageAcceptedSize is set according to the ratio checked when creating the code bit ID. Unit px
  2. When setNativeAdType requests native ads, be sure to call this method and set the parameter to TYPE_BANNER


Contents
Contact us