Chartboost广告加载活动会暂停屏幕很长时间以加载interterestial。我想知道如何从chartboost中删除此加载场景,以便我可以在其他活动中移动到我的应用程序
@Override
protected void onStart() {
super.onStart();
this.cb.showMoreApps();
this.cb.onStart(this); //By Rishi
// Notify the beginning of a user session. Must not be dependent on user
// actions or any prior network requests.
this.cb.startSession();
// Show an interstitial
this.cb.showInterstitial();
}
@Override
protected void onStop() {
super.onStop();
this.cb.onStop(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
this.cb.onDestroy(this);
}
public void onLoadButtonClick(View view) {
this.cb.showInterstitial();
String toastStr = "Loading Interstitial";
if (cb.hasCachedInterstitial())
toastStr = "Loading Interstitial From Cache";
Toast.makeText(this, toastStr, Toast.LENGTH_SHORT).show();
}
private ChartboostDelegate chartBoostDelegate = new ChartboostDelegate() {
public boolean shouldDisplayInterstitial(String location) {
Log.i("", "SHOULD DISPLAY INTERSTITIAL '" + location + "'?");
return true;
}
public boolean shouldRequestInterstitial(String location) {
Log.i("", "SHOULD REQUEST INSTERSTITIAL '" + location + "'?");
return true;
}
public void didCacheInterstitial(String location) {
Log.i("", "INTERSTITIAL '" + location + "' CACHED");
}
public void didFailToLoadInterstitial(String location) {
// Show a house ad or do something else when a chartboost
// interstitial fails to load
Log.i("", "INTERSTITIAL '" + location + "' REQUEST FAILED");
// Toast.makeText(FrozenBubble.this,
//"Interstitial '"+location+"' Load Failed";
// Toast.LENGTH_SHORT).show();
}
public void didDismissInterstitial(String location) {
// Immediately re-caches an interstitial
cb.cacheInterstitial(location);
Log.i("", "INTERSTITIAL '" + location + "' DISMISSED");
// Toast.makeText(FrozenBubble.this,
// "Dismissed Interstitial '"+location+"'",
// Toast.LENGTH_SHORT).show();
}
public void didCloseInterstitial(String location) {
Log.i("", "INSTERSTITIAL '" + location + "' CLOSED");
// Toast.makeText(FrozenBubble.this,
// "Closed Interstitial '"+location+"'",
// Toast.LENGTH_SHORT).show();
}
public void didClickInterstitial(String location) {
Log.i("", "DID CLICK INTERSTITIAL '" + location + "'");
// Toast.makeText(FrozenBubble.this,
// "Clicked Interstitial '"+location+"'",
// Toast.LENGTH_SHORT).show();
}
public void didShowInterstitial(String location) {
Log.i("", "INTERSTITIAL '" + location + "' SHOWN");
}
public void didFailToLoadUrl(String url) {
// Show a house ad or do something else when a chartboost
// interstitial fails to load
Log.i("", "URL '" + url + "' REQUEST FAILED");
// Toast.makeText(FrozenBubble.this, "URL '"+url+"' Load Failed",
// Toast.LENGTH_SHORT).show();
}
public boolean shouldDisplayLoadingViewForMoreApps() {
return true;
}
public boolean shouldRequestMoreApps() {
return true;
}
public boolean shouldDisplayMoreApps() {
Log.i("", "SHOULD DISPLAY MORE APPS?");
return true;
}
public void didFailToLoadMoreApps() {
Log.i("", "MORE APPS REQUEST FAILED");
//Toast.makeText(Menu.this, "More Apps Load Failed", Toast.LENGTH_SHORT).show();
}
public void didCacheMoreApps() {
Log.i("", "MORE APPS CACHED");
}
public void didDismissMoreApps() {
Log.i("", "MORE APPS DISMISSED");
//Toast.makeText(Menu.this, "Dismissed More Apps", Toast.LENGTH_SHORT) .show();
}
public void didCloseMoreApps() {
Log.i("", "MORE APPS CLOSED");
//Toast.makeText(Menu.this, "Closed More Apps", Toast.LENGTH_SHORT).show();
}
public void didClickMoreApps() {
Log.i("", "MORE APPS CLICKED");
//Toast.makeText(Menu.this, "Clicked More Apps", Toast.LENGTH_SHORT).show();
}
public void didShowMoreApps() {
Log.i("", "MORE APPS SHOWED");
}
public boolean shouldRequestInterstitialsInFirstSession() {
return true;
}
};
答案 0 :(得分:0)
快速简便的解决方法是让shouldDisplayLoadingViewForMoreApps
委托方法返回false。
然而,正确的方法是始终缓存插页式广告(cacheInterstitial
)&显示之前的应用页面(cacheMoreApps
)越多。这样SDK就会预加载所有资产,根本不会有加载时间。
如果您需要更多帮助,请随时发送电子邮件至support@chartboost.com。