Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question [UNITY ADS] Right way to present ads

Discussion in 'Unity Ads & User Acquisition' started by Bitwak, Nov 12, 2021.

  1. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    28
    Hello guys, I'm wondering which is the best way to handle the presentation of ADS windows with the unity ads plugin.

    Before presenting and ads with the
    Code (CSharp):
    1. Advertisment.Show
    function I normally disable the main camera and I enable it again when the ADV is dismissed and clear memory as much as possible with
    Code (CSharp):
    1. Resources.UnloadUnusedAssets();
    .

    Without these "tricks" I encountered cases where the memory consumption jumped to huge numbers crashing the game.

    Are there any specific tasks to follow before presenting the ADS?
     
  2. Unity_Quinn

    Unity_Quinn

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    102
    Hi @Bitwaker, thank you for reaching out! Sorry to hear about the issues with crashing!

    In general, when an ad is ready, you should just be able to call Advertisement.Show without issues. Would you be comfortable sharing the full code you are using for your ads logic? This is an interesting case, and we would like to investigate further.

    Also, would you mind please confirming how you're testing this? Are you testing with a physical device? What model and OS version? Are you using test ads or production ads?

    Thanks!
     
  3. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    28
    Hello @Unity_Quinn, I'm going to open a ticket to share all the needed info.
    We are testing on iOS (the memory issue is reproducible with both iOS 14 and 15). I have identified a specific case where it happens systematically, where we are showing two full-screen canvas. The only option we found to fix the memory issue is to disable our main camera.

    Should I mention you in the ticket?
     
  4. Unity_Quinn

    Unity_Quinn

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    102
    Hi @Bitwaker,

    Thank you for following up on this. If you haven't already created the ticket, can you please include a link to this forum thread?

    I appreciate your help here and hope that we can get this sorted out as soon as possible :)
     
  5. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    28
    Hello @Unity_Quinn, I still have to open the ticket! my apologies... we are working at a release. I'll do my best to share it before the end of the next week