Search Unity

rewarded ad callback function is not executed!

Discussion in 'Unity Ads & User Acquisition' started by a33366, Nov 6, 2018.

  1. a33366

    a33366

    Joined:
    Jul 26, 2017
    Posts:
    26
    just Android
    if (result == ShowResult.Finished)
    {
    RunAgain(adCoins);
    }

    RunAgain not executed!

    Monitor Display :
    Can only be called from the main thread

    I'm sorry for my poor English



     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @a33366

    This is a known issue in SDK 3.0 that will be fixed in the next patch.

    In the meantime, you can workaround this problem by calling RunAgain from a Coroutine that is triggered in the callback.

    Code (CSharp):
    1. if(result == ShowResult.Finished)
    2. {
    3.     StartCoroutine(AdCoins(adCoins));
    4. }
    5. //...
    6. public void IEnumerator AdCoins(float adCoins)
    7. {
    8.     yield return null;
    9.     RunAgain(adCoins)
    10. }
    11.