Search Unity

Question Is IronSource the ONLY future for Ads? I've been at this for a week already. I'm tired.

Discussion in 'LevelPlay' started by Tsondre, Dec 15, 2022.

  1. Tsondre

    Tsondre

    Joined:
    Apr 9, 2016
    Posts:
    30
    Is anyone else having issues with integrating this SDK and using it successfully?

    I cannot for the life of me figure out how to get these Ads working on my mobile device.

    The documentation mentions to run:
    IronSource.Agent.validateIntegration();


    But I get an "Unsupported Platform" message back. How am I supposed to know if it's setup properly if it's getting bottlenecked in Editor? Is there a way to simulate the Android environment on PC?

    Is the documentation for IronSource updated? The Demo Project C# File and the Documentation are not consistent with the functions they tell you to use, to initialize the ads.

    How long will Unity Mediation be supported? What are my other options?
     
  2. PapayaLimon

    PapayaLimon

    Joined:
    Aug 22, 2018
    Posts:
    85
    I was able to show the banner, but unfortunately it only works on build, it doesn't work in the editor or with UnityRemote5 either :(
     
  3. Saripsis

    Saripsis

    Joined:
    May 29, 2015
    Posts:
    5
    This is what I used to get Rewarded Ads working.
    AdController is a seperate custom script where I control the rewards.
    Don't know how good it is, but it seems to work. . .at least testing. I had to build and run each time to make sure.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class ISInit : MonoBehaviour
    6. {
    7.     AdController adController;
    8.  
    9.  
    10.     // Start is called before the first frame update
    11.     void Start()
    12.     {
    13.         adController = AdController.adController;  //gets the adController
    14.  
    15.         //pulls the app key data from the adController
    16.         string androidAppKey = adController.androidAppKey;
    17.         string iosAppKey = adController.iosAppKey;
    18.  
    19.      
    20.         //Switches between Android and Unity appKeys
    21.         #if UNITY_ANDROID
    22.             string appKey = androidAppKey;
    23.         #elif UNITY_IPHONE
    24.             string appKey = iosAppKey;
    25.         #else
    26.             string appKey = "unexpected_platform";
    27.         #endif
    28.  
    29.         Debug.Log("unity-script: IronSource.Agent.validateIntegration");
    30.         IronSource.Agent.validateIntegration();
    31.  
    32.         Debug.Log("unity-script: unity version" + IronSource.unityVersion());
    33.  
    34.         // SDK init
    35.         Debug.Log("unity-script: IronSource.Agent.init");
    36.         IronSource.Agent.init(appKey);
    37.     }
    38.  
    39.     void OnApplicationPause(bool isPaused)
    40.     {
    41.         IronSource.Agent.onApplicationPause(isPaused);
    42.     }
    43.  
    44. }
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class ISRewards : MonoBehaviour
    6. {
    7.     AdController adController;
    8.  
    9.     // Start is called before the first frame update
    10.     void Start()
    11.     {
    12.  
    13.         adController = AdController.adController;  //assigns adController
    14.  
    15.         IronSourceEvents.onRewardedVideoAdOpenedEvent += RewardedVideoAdOpenedEvent;
    16.         IronSourceEvents.onRewardedVideoAdClickedEvent += RewardedVideoAdClickedEvent;
    17.         IronSourceEvents.onRewardedVideoAdClosedEvent += RewardedVideoAdClosedEvent;
    18.         IronSourceEvents.onRewardedVideoAvailabilityChangedEvent += RewardedVideoAvailabilityChangedEvent;
    19.         IronSourceEvents.onRewardedVideoAdStartedEvent += RewardedVideoAdStartedEvent;
    20.         IronSourceEvents.onRewardedVideoAdEndedEvent += RewardedVideoAdEndedEvent;
    21.         IronSourceEvents.onRewardedVideoAdRewardedEvent += RewardedVideoAdRewardedEvent;
    22.         IronSourceEvents.onRewardedVideoAdShowFailedEvent += RewardedVideoAdShowFailedEvent;
    23.         IronSource.Agent.shouldTrackNetworkState(true);
    24.     }
    25.  
    26.  
    27.     public bool AdLoaded()
    28.     {
    29.         bool available = IronSource.Agent.isRewardedVideoAvailable();
    30.  
    31.         return available;
    32.     }
    33.  
    34.     public void ShowAd()
    35.     {
    36.         IronSource.Agent.showRewardedVideo();
    37.     }
    38.  
    39.     void RewardedVideoAdRewardedEvent(IronSourcePlacement ssp)  //REWARDS****************************************************************
    40.     {
    41.         //TODO - here you can reward the user according to the reward name and amount
    42.         ssp.getPlacementName();
    43.         ssp.getRewardName();
    44.         ssp.getRewardAmount();
    45.  
    46.         adController.AdRewards();
    47.     }
    48.  
    49.     //Invoked when the RewardedVideo ad view has opened.
    50.     //Your Activity will lose focus. Please avoid performing heavy
    51.     //tasks till the video ad will be closed.
    52.     void RewardedVideoAdOpenedEvent()
    53.     {
    54.     }
    55.     //Invoked when the RewardedVideo ad view is about to be closed.
    56.     //Your activity will now regain its focus.
    57.     void RewardedVideoAdClosedEvent()
    58.     {
    59.     }
    60.     //Invoked when there is a change in the ad availability status.
    61.     //@param - available - value will change to true when rewarded videos are available.
    62.     //You can then show the video by calling showRewardedVideo().
    63.     //Value will change to false when no videos are available.
    64.     void RewardedVideoAvailabilityChangedEvent(bool available)
    65.     {
    66.         //Change the in-app 'Traffic Driver' state according to availability.
    67.         bool rewardedVideoAvailability = available;
    68.     }
    69.  
    70.     //Invoked when the user completed the video and should be rewarded.
    71.     //If using server-to-server callbacks you may ignore this events and wait for
    72.     // the callback from the  ironSource server.
    73.     //@param - placement - placement object which contains the reward data
    74.  
    75.     //Invoked when the Rewarded Video failed to show
    76.     //@param description - string - contains information about the failure.
    77.     void RewardedVideoAdShowFailedEvent(IronSourceError error)
    78.     {
    79.     }
    80.  
    81.     // ----------------------------------------------------------------------------------------
    82.     // Note: the events below are not available for all supported rewarded video ad networks.
    83.     // Check which events are available per ad network you choose to include in your build.
    84.     // We recommend only using events which register to ALL ad networks you include in your build.
    85.     // ----------------------------------------------------------------------------------------
    86.  
    87.     //Invoked when the video ad starts playing.
    88.     void RewardedVideoAdStartedEvent()
    89.     {
    90.     }
    91.     //Invoked when the video ad finishes playing.
    92.     void RewardedVideoAdEndedEvent()
    93.     {
    94.     }
    95.     //Invoked when the video ad is clicked.
    96.     void RewardedVideoAdClickedEvent(IronSourcePlacement placement)
    97.     {
    98.     }
    99.  
    100.  
    101.  
    102.  
    103.  
    104.     /*   void RewardedVideoAdClosedEvent()
    105.        {
    106.            IronSource.Agent.init(appkey, IronSourceAdUnits.REWARDED_VIDEO);
    107.            IronSource.Agent.shouldTrackNetworkState(true);
    108.        }
    109.  
    110.        void RewardedVideoAvailabilityChangedEvent(bool available)
    111.        {
    112.            //Change the in-app 'Traffic Driver' state according to availability.
    113.            bool rewardedVideoAvailability = available;
    114.  
    115.        }
    116.     */
    117. }
     
    valonsoft likes this.
  4. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    Hey guys,
    Unfortunately trying to run in editor will result in unsupported platform errors for the moment. The editor support that was present in Unity Mediation is unfortunately not available in LevelPlay at the moment. We may bring the feature over to LevelPlay in the future, but for now you will have to do all testing on a mobile device.

    In the meantime you may want to check out that guide: https://developers.is.com/ironsource-mobile/general/move-to-unity-levelplay/

    We are also working on other Migration guides.

    @Tsondre as ironSource is now part of Unity, LevelPlay will be the Mediation solution going forward. We are working on integrating it into the editor to enhance the user experience, and hopefully bring the best of Unity Mediation into LevelPlay, but Unity Mediation will no longer receive any updates as our efforts will be put on LevelPlay.

    If there is anything please let us know! :)
     
  5. nbg_yalta

    nbg_yalta

    Joined:
    Oct 3, 2012
    Posts:
    378
    Any info on how long it will take and how do I know it is done?
     
  6. jcGrenier

    jcGrenier

    Unity Technologies

    Joined:
    Feb 23, 2021
    Posts:
    145
    This will be rolled out progressively over the next releases. I don't think we have a public roadmap, but you can already install the LevelPlay package through Unity's package manager, by looking for Ads Mediation (com.unity.services.levelplay) although the editor integration at the moment is minimal, it should get better with every release moving forward.
     
  7. shinichikudo997

    shinichikudo997

    Joined:
    Jul 1, 2018
    Posts:
    33
    I so miss my simple and soothing unity ads
     
  8. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Unity mediation worked fine too, it's a shame it was deprecated
     
    shinichikudo997 likes this.
  9. de_CLAS_Softworks

    de_CLAS_Softworks

    Joined:
    Oct 8, 2019
    Posts:
    33
  10. shinichikudo997

    shinichikudo997

    Joined:
    Jul 1, 2018
    Posts:
    33
    Thank you for the suggestion and I am actually sticking with unity ads, I cannot trust unity now it has been deprecating things left and right.
     
  11. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Unity mediation was awesome, really easy to implement and working very well. It's a f*****ing shame they deprecated it.
    I tried levelplay but it's horrendous to implement, get it working etc. Plus they favor their own ads which have trash ecpm (lost 40% of my revenue switching to levelplay).
    Now I'm trying admob and even though the documentation and fill rates are high, there is clearly a lack of support that unity mediation filled. I remember a guy contacting me in DM to optimize my waterfalls and such allowing me to greatly improve my ecpm
     
  12. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    I just want to thank the people in this thread for illuminating the problems with LevelPlay for me. I wanted to update to it in the hopes of staying compliant but after reading what I've read here, I'm going to roll my code back and just stick to Unity Mediation as long as I can. What a shame.
     
    EdwinOlima and rbitard like this.
  13. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    I should have done that, unity mediation was the best ECPM I ever had
     
  14. DaveKap

    DaveKap

    Joined:
    Mar 6, 2013
    Posts:
    94
    Sadly it looks like they're killing Unity Mediation October 1st so good luck with the upgrade.