Menu

Self-rendering shake

Shake the current information flow launched by Baidu, Pangolin, Youlianghui, and Kuaishou

Advertising platformYes Advertising platform activation permission is requiredTopOn SDK version requirementsTopOn background configurationLink
BaiduRequiredTopOn SDK v6.2.60 and above supportedNoneView
KuaishouRequiredTopOn Android SDK v6.2.65 and above are supported (TopOn iOS SDK is not supported yet)YesView
PangolinOpen by default. Can be turned on when creating a native feedNoneNoneView
YoulianghuiRequiredNoneNoneYou can contact Youlianghui to obtain

1. Usage process of self-rendering shake function of advertising platform information flow

1. You need to apply to the advertising platform for the information flow self-rendering shake function permission, and the third-party advertising slot ID that has this function. 2. Your application needs to add Shake interaction to the information flow. When using a third-party ad slot that supports shake, the information flow ad must display the "shake" interaction. Otherwise, shaking the mobile phone hand when the user does not see the relevant prompt of "Shake" will trigger clicks and jumps on the advertising platform, which does not meet regulatory compliance requirements. Shake For interaction, please refer to the pangolin example:

3. If shaking the interactive display area can trigger ad clicks, the recommended copy configuration is Click or shake to jump to the details page or third-party application 4. Add traffic grouping in the TopOn background (using application version rules), for information flows that have been supported The application version of "Shake" interaction adds a third-party advertising ID that supports the shake function. 5. For the sensitivity configuration of shake, please contact the advertising platform AM for adjustment

2. TopOn background configuration

2.1 Configure traffic grouping for applications that support information flow shake interaction

When using the information flow self-rendering shake function of the advertising platform, your application needs to add Shake< /strong>Interaction. It is recommended that you configure the corresponding third-party advertising slot ID only for applications that support information flow shake interaction. If you use the corresponding third-party advertising slot ID for applications that do not support information flow shake interaction, third-party ad slot ID, your app will not meet regulatory compliance requirements.

You can use TopOn's traffic grouping to target supported information flowsShake The interactive application version is configured with the corresponding third-party advertising slot ID.


2.2 Kuaishou information flow self-rendering Shake configuration

1. When using the Kuaishou information flow self-rendering shake function, you need to turn it on when adding the Kuaishou information flow advertising source Shake switch

2. If your account does not have this switch, please contact TopOn to turn it on.

3. Code settings

1. Baidu Shake View requires developers to call code and render it to the layout to trigger the shake. The sample code is as follows:

Tip: No additional code is required to set up Shake for other platforms.

private static void renderShakeView(Context context, ATNativeMaterial adMaterial, FrameLayout shakeViewContainer) {
    int shakeViewWidth = dip2px(context, 100);  //The width of the component shall not be less than 80dp
    int shakeViewHeight = dip2px(context, 100); //Component height, not less than 80dp
    View shakeView = adMaterial.getShakeView(shakeViewWidth, shakeViewHeight, new ATShakeViewListener() {
        @Override
        public void onDismiss() {
            shakeViewContainer.setVisibility(Viejayw.GONE);
        }
    });
    if (shakeView != null && shakeViewContainer != null) {
        shakeViewContainer.setVisibility(View.VISIBLE);
        shakeViewContainer.removeAllViews();
        FrameLayout.LayoutParams shakeViewLayoutParams = new FrameLayout.LayoutParams(shakeViewWidth, shakeViewHeight);
        shakeViewLayoutParams.gravity = Gravity.CENTER;
        shakeViewContainer.addView(shakeView, shakeViewLayoutParams);
    }
}


Last modified: 2025-05-30Powered by