Rewarded Ads does not reward the user on IOS

99 views
Skip to first unread message

Atahan Altıntaş

unread,
Aug 24, 2023, 5:01:30 PM8/24/23
to Google Mobile Ads SDK Developers
We are making a game with Unity c#. I published my first game in android and now it is working perfectly on android. Now i am publishing on appstore for Apple users but there is a problem that the rewarded ads are not giving the rewards. With Unity SDK i followed the steps and there is no IOS guidle line except ATT message. Also there is an other problem that when ads are showing the game does not stop like on Android. For example there is still game music while users wacthes the video. I wrote the code bellow. All of my rewarded ads uses similar script with different reward methods.(I deleted the unit IDs thinking it is more appropriate this way and they dont have any problem)
 private string _adUnitId;
        private RewardedAd rewardedAd;
    // Start is called before the first frame update
    void Start()
    {  
        #if UNITY_IOS
      _adUnitId = "..................................";
    #endif

     #if UNITY_ANDROID
      _adUnitId  = "............................";
    #endif
        MobileAds.Initialize((InitializationStatus initStatus) =>
        {
            // This callback is called once the MobileAds SDK is initialized.
        });
        LoadRewardedAd();
    }

    // Update is called once per frame
   
     public void LoadRewardedAd()
  {
      // Clean up the old ad before loading a new one.
      if (rewardedAd != null)
      {
            rewardedAd.Destroy();
            rewardedAd = null;
      }

      Debug.Log("Loading the rewarded ad.");

      // create our request used to load the ad.
      var adRequest = new AdRequest();
      //adRequest.Keywords.Add("unity-admob-sample");

      // send the request to load the ad.
      RewardedAd.Load(_adUnitId, adRequest,
          (RewardedAd ad, LoadAdError error) =>
          {
              // if error is not null, the load request failed.
              if (error != null || ad == null)
              {
                  Debug.LogError("Rewarded ad failed to load an ad " +
                                 "with error : " + error);
                  return;
              }

              Debug.Log("Rewarded ad loaded with response : "
                        + ad.GetResponseInfo());

              rewardedAd = ad;
          });
  }
  public void ShowRewardedAd()
{
    const string rewardMsg =
        "Rewarded ad rewarded the user. Type: {0}, amount: {1}.";

    if (rewardedAd != null && rewardedAd.CanShowAd())
    {
        rewardedAd.Show((Reward reward) =>
        {
            // TODO: Reward the user.
            AB_DictionaryFileManager.Save_to_Profile("Ticket",1);
            Debug.Log(String.Format(rewardMsg, reward.Type, reward.Amount));
        });
    }
}

Mobile Ads SDK Forum Advisor

unread,
Aug 24, 2023, 6:29:35 PM8/24/23
to atahanalt...@gmail.com, google-adm...@googlegroups.com
Hello,

Thank you for reaching out to us.

For us to properly troubleshoot your issue, kindly provide us the following information below privately:
  • Sample App
  • Steps to replicate
  • App ID
  • SDK Version
  • Device name and versions affected
You can provide the following details via reply privately to author option or directly provide it to the link below.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002o866pQAA&entry.80707362=00195395

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

This message is in relation to case "ref:_00D1U1174p._5004Q2o866p:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Reply all
Reply to author
Forward
0 new messages