0

Chartboost 广告加载活动会长时间暂停屏幕以加载有趣的内容。我想知道如何从 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;
  }
 };
4

1 回答 1

0

快速简单的解决方法是让shouldDisplayLoadingViewForMoreApps委托方法返回 false。

然而,正确的做法是始终在显示插页式广告 ( cacheInterstitial) 和更多应用页面 ( cacheMoreApps) 之前对其进行缓存。这样,SDK 将预加载所有资产,并且根本没有加载时间。

如果您需要更多帮助,请随时发送电子邮件至 support@chartboost.com。

于 2013-10-31T04:17:37.330 回答