如何在间隔或3-4次点击后在网络视图中显示插页式广告?

问题描述 投票:0回答:1

我有一个wordpress网站,并且我有一个webview应用程序,并且我在任何按钮单击时都实施了插页式广告,因此,每当单击链接时,就会显示整页广告,我如何降低它的出现频率,我希望它出现好吧,让我们说3或4次点击后?

android webview onclick admob interstitial
1个回答
0
投票

为了显示Google非页内广告,您需要应用一些条件。首先,您必须创建一个静态变量并将其值设置为一个 static counter = 1;

if (counter == 3){
// your interstitial code basically call its method show such as ad.show()
counter++;
}
else if (counter == 4){
// your interstitial code basically call its method show such as ad.show()
counter = 1;
}
else{
counter += 1;
}

© www.soinside.com 2019 - 2024. All rights reserved.