Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by huloo · Aug 24, 2015 at 11:27 AM · pluginadvertising

[Solved] Chartboost ad is not working when reloading scene

Hi. I am trying to integrate Chartboost Ad into my game.

I have added interstitial Ad & rewarded video code. Both Ad work fine when i first start up the game. However, both Ad do not work after i called Restart ().

I am using Unity version 5.1.1 and the newest Chartboost SDK version 5.5.3

My workflow:

Interstitial Ad is shown when player lose the game. Lose () is called in this situation. Rewarded video is shown when player press EarnCoin button. EarnCoins() is called when the button is pressed. Restart() is called when restart button is pressed.

My code:

 private int frameCount = 0;
 void Start () {
                Chartboost.cacheInterstitial(CBLocation.Default);
                Chartboost.cacheRewardedVideo(CBLocation.Default) ;
                Chartboost.setAutoCacheAds(true);
 }
 
 void Lose () {
                  if (Chartboost.hasInterstitial(CBLocation.Default)) {
                Chartboost.showInterstitial (CBLocation.Default);
                  }
 }
 
 void EarnCoins () {
 
         if (Chartboost.hasRewardedVideo (CBLocation.Default)) {
             Chartboost.showRewardedVideo (CBLocation.Default);
                  }
 }      
     
 void Restart () {
         Application.LoadLevel (Application.loadedLevel);
 }

 void Update () {
            frameCount++;
 
            if( frameCount > 30 && Chartboost.hasInterstitial(CBLocation.Default) == false){
             Chartboost.cacheInterstitial(CBLocation.Default);        
             frameCount = 0;
         }
 
             if( frameCount > 30 && Chartboost.hasRewardedVideo(CBLocation.Default) == false){        
             Chartboost.cacheRewardedVideo(CBLocation.Default);    
             frameCount = 0;
         }

I have used ChartboostExampleScript to check. Everytime i play the game as the 1st time, both Ad can cache automatically. However, after i pressed restart button, both Ad can't cache automatically. Chartboost.hasInterstitial and Chartboost.hasRewardedVideo keep showing "false" in the log.

Do you guys have any ideas? Any suggestion would be appreciated :]

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Nidhii · Nov 23, 2015 at 01:48 PM 0
Share

@huloo Did you find any solution to your problem? I am in similar situation and have tried many things. No luck yet.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by huloo · Nov 23, 2015 at 02:22 PM

@IES

I solved the problem by putting the Chartboost prefab in a scene which only load once.

Hope this help :]

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Le-Pampelmuse · Nov 23, 2015 at 02:42 PM 0
Share

Please remove the "Solved" from your question That's not how to mark questions as solved on this forum. That's what the "Accept answer" function is for ;)

You can click accept on your answer and after that you can close it. That's fine. ;)

Here a quick re$$anonymous$$der:

The Frequently Asked Questions and the User Guide.

avatar image Nidhii · Nov 27, 2015 at 11:18 AM 0
Share

Thanks a lot for your help. :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

LeadBolt Ads For Android 1 Answer

Admob Plugin - Android License 0 Answers

Is there any multi-platform Ads solution or plugin? 1 Answer

Homebase SDK android Plugin Help 0 Answers

UI Plugin to connect to external shader editor? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges