Search Unity

Mobile Ads - Simple way to integrate ads in your app

Discussion in 'Assets and Asset Store' started by GleyGames, May 1, 2018.

?

What other advertisers we should add to our plugin?

Poll closed Oct 21, 2019.
  1. Facebook Ads

    64.7%
  2. AppLovin

    34.1%
  3. Tapjoy

    10.6%
  4. MoPub

    15.3%
  5. LeadBolt

    7.1%
  6. ironSource

    20.0%
  7. inMobi

    8.2%
  8. Mobusi

    0 vote(s)
    0.0%
  9. Appnext

    2.4%
  10. Appodeal

    8.2%
Multiple votes are allowed.
  1. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Currently App Open ad is not supported. Maybe it will be in the future but I cannot give you a time estimate right now.
     
  2. lukezinsan

    lukezinsan

    Joined:
    Jan 16, 2014
    Posts:
    19
    hi thanks for your replay, i will wait for the update,
    btw i got error when use admob
    "
    Assets\GoogleMobileAds\Editor\GleyAdmobPatch.cs(9,46): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'GoogleMobileAdsAndroidAppId' and no accessible extension method 'GoogleMobileAdsAndroidAppId' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
    "
    i am use unity 2019.4
     
  3. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Please use the latest version of Mobile Ads and the latest version of Admob SDK and your error should go away.
     
  4. lukezinsan

    lukezinsan

    Joined:
    Jan 16, 2014
    Posts:
    19
    ok thanks
     
  5. XerusGames

    XerusGames

    Joined:
    Sep 22, 2020
    Posts:
    6
    I'm having a trouble with Unity ads. ShowRewardedVideo(CompleteMethod) runs perfectly with Admob. But if I use Unity ads, the ads just closes and CompleMethod wasn't called at all. Can you take a look at it?

    Code (CSharp):
    1. public override void OnButtonClicked()
    2.     {
    3.         if (Advertisements.Instance.IsRewardVideoAvailable())
    4.         {
    5.             ShowRewardedVideo();
    6.         }
    7.         else
    8.         {
    9.             Debug.Log("reward video not available");
    10.         }
    11.            
    12.     }
    13.  
    14.     public void ShowRewardedVideo()
    15.     {
    16.         Debug.Log("Show video");
    17.         Advertisements.Instance.ShowRewardedVideo(CompleteMethod);
    18.     }
    19.  
    20.  
    21.     private void CompleteMethod(bool completed, string advertiser)
    22.     {
    23.         Debug.Log("Closed rewarded from: " + advertiser + " -> Completed " + completed);
    24.  
    25.         if (completed == true)
    26.         {
    27.             //Reward player
    28.             Debug.Log("Player rewarded");
    29.         }
    30.         else
    31.         {
    32.             Debug.Log("Reward video cancelled");
    33.         }
    34.     }
     
  6. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    If your ads run with Admob your code is correct. If you are using some version of Unity 2020 please make sure your ads are enabled from services. There is a known issue inside Unity and they said it will be fixed but it seems it is not yet.
    Thank you!
     
  7. XerusGames

    XerusGames

    Joined:
    Sep 22, 2020
    Posts:
    6
    Thank you for your quick response. I think my Unity Ads is set up correctly. I'm on Unity 2020.3.18f. Like I mentioned, Unity ads shows but when I close it, the CompleteMethod isn't called. Is there a workaround? It's pointless if I have to abandon ads mediation.
     

    Attached Files:

  8. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    I can confirm that Unity ads work correctly for Unity 2020 and the callback is properly triggered. Make sure your build is not in development mode. Unity ads do not work on development builds.
     
  9. XerusGames

    XerusGames

    Joined:
    Sep 22, 2020
    Posts:
    6
    It's super weird. My build is not in development mode either. Do I have to add any listeners in the CustomUnityAds? Maybe I should go ahead with Admob only and take a look at Unity Ads later.
     
  10. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    If you contact me by email with your invoice number I will send you a complete working project with Unity already integrated.
    You do not have to change anything inside your code, all should work out of the box.

    Use this video and debug your app on device and see what error do you get when the ad is finished:
     
    XerusGames likes this.
  11. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I've followed this video:

    and tried to set up unity ads for an android build. I've tried to run it on both the device and unity editor, but I get this message: "No Banners Available", and I don't get any ads. Am I missing something?
     
  12. r137

    r137

    Joined:
    Mar 12, 2018
    Posts:
    47
    Latest version of admob sdk v6.1.2 causes this error:

    Code (CSharp):
    1. Assets\GoogleMobileAds\Editor\GleyAdmobPatch.cs(11,46): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'WriteSettingsToFile' and no accessible extension method 'WriteSettingsToFile' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
    2.  
    I think google removed this method. I added it manually to SDK's file, for now problem seems solved.

    2021-11-01 15_11_46-GitHub Desktop.png
     
  13. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Unity banners have a limited fill rate. They are only available in the US i think. If you need banners inside your app I recommend to use Admob or Applovin not Unity ads.
     
    daniel6839 likes this.
  14. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    You are right, that method was removed so please update to the latest version of Gley Mobile Ads and install the AdmobPatch package from the plugin. It will fix your error.

    Thank you!
     
    r137 likes this.
  15. scorpionfeast

    scorpionfeast

    Joined:
    Dec 5, 2014
    Posts:
    18
    Hello,
    Do Easy Mobile Pro supports mediation with Mopub. I want to integrate mopub with admob, applovin and unity ads... But When I add mediation sdk from Mopub sdk manager, the build just crashes on android...
     
  16. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    I think you are on the wrong forum. This forum is for:
    https://assetstore.unity.com/packages/tools/integration/mobile-ads-gdpr-ios-14-5-compliant-102892

    And yes, Mobile Ads supports mediation through mopub, you can check the public repository available on the store page.
     
  17. joskarl

    joskarl

    Joined:
    Feb 15, 2016
    Posts:
    1
    Hi!
    Our app rejected do to App Tracking Transparency permission request popup not showing on latest iOS 15.1. On previous versions just fine. Any fix for this?
     
  18. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    I just tested and the popup showed on iOS 15.1 without any changes. Make sure you are using the latest version of Ads sdk and that your app is submitted with the latest version of xCode.
     
  19. spawnpointgaming

    spawnpointgaming

    Joined:
    Feb 5, 2019
    Posts:
    16
    Well I am using the latest version of your asset 1.4.19 with unity 2020.3.24f1 with unity advertisement package 4.0.0 I am getting this error

    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(101,27): error CS1501: No overload for method 'Initialize' takes 4 arguments
    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(176,34): error CS0117: 'Advertisement' does not contain a definition for 'IsReady'
    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(226,34): error CS0117: 'Advertisement' does not contain a definition for 'IsReady'
    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(433,34): error CS0117: 'Advertisement' does not contain a definition for 'IsReady'
    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(482,114): error CS0117: 'Advertisement' does not contain a definition for 'IsReady'
    Assets\GleyPlugins\Ads\Scripts\SupportedAdvertisers\CustomUnityAds.cs(483,123): error CS0117: 'Advertisement' does not contain a definition for 'IsReady'

    Could you please let me know as how to solve this error. Also if I change the unity advertisement package to 3.7.5 but in both case there are no ads working using admob & unityads .
     
  20. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    The latest version of the asset is 1.10.6 and those errors are fixed. Please use that version and all will work. Thank you!
     
  21. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    Hi, i just updated admob and gley mobile ads, installed the admob patch, and i'm getting some errors.
    My app id and ad unit id's are all correct, and i can't find any obvious problems. Any idea what's going on? Thanks


    Code (CSharp):
    1. Assets\GoogleMobileAds\Editor\AndroidBuildPostProcessor.cs(14,47): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'IsAdManagerEnabled' and no accessible extension method 'IsAdManagerEnabled' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
    2. Assets\GoogleMobileAds\Editor\AndroidBuildPostProcessor.cs(14,103): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'IsAdMobEnabled' and no accessible extension method 'IsAdMobEnabled' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
    3. Assets\GoogleMobileAds\Editor\AndroidBuildPostProcessor.cs(19,46): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'IsAdMobEnabled' and no accessible extension method 'IsAdMobEnabled' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
    4. Assets\GoogleMobileAds\Editor\AndroidBuildPostProcessor.cs(19,97): error CS1061: 'GoogleMobileAdsSettings' does not contain a definition for 'AdMobAndroidAppId' and no accessible extension method 'AdMobAndroidAppId' accepting a first argument of type 'GoogleMobileAdsSettings' could be found (are you missing a using directive or an assembly reference?)
     
  22. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Please make sure you to delete the old version of Admob completely and import the new one and it should work.
     
  23. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    That fixed it. I just imported the new version over the old version, but deleting it and adding it again and then applying the patch again did eliminate the errors.
    Thanks
     
  24. dayjur

    dayjur

    Joined:
    Sep 6, 2014
    Posts:
    128
    On Android mok banner and interstitial ads show in editor when I switch to IOS they do not show, is this correct
     
  25. dayjur

    dayjur

    Joined:
    Sep 6, 2014
    Posts:
    128
    appears was not updating scripting symbols in player settings any way its working now
     
  26. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    My app runs in landscape mode with "Render Outside Safe Area" in Player Settings turned on. I've placed an AdMob banner in the menu scene but the banner is not centered. Is there any way I could center it?
     
  27. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Sorry, you cannot change the position of the banner using Mobile Ads plugin,
     
  28. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I had the same problem, and I resubmitted with the updated version of Xcode. Now they asking me where the permission request is located.
     
  29. peanut23

    peanut23

    Joined:
    Apr 27, 2021
    Posts:
    3
    Hello,
    Please send us the full error message to be able to see the entire scenario.
     
  30. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I’ve followed this tutorial:



    to setup the GDPR popup, but I don’t think this calls the App Transparency popup. However, when I tested in the provided TestAds scene everything seems to work fine.
     
  31. mncgames

    mncgames

    Joined:
    Nov 28, 2018
    Posts:
    6
    Hello, We want to implement vungle ads into our games but the game app crash when it started. We already delete Assets/Plugins/Android/androidx.core.core-1.0.0 from vungle unity package. We are using unity 2020.3.20. These are the errors that occur when we logcat the app:

    Code (CSharp):
    1. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime FATAL EXCEPTION: vng_background-th-1
    2. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime Process: com.mncgames.play.kikorun, PID: 23494
    3. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/Interceptor;
    4. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at com.vungle.warren.Plugin.addWrapperInfo(Plugin.java:16)
    5. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at com.vungle.androidplugin.VunglePlugin$1.run(VunglePlugin.java:94)
    6. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at com.vungle.androidplugin.Utility$1.run(Utility.java:154)
    7. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at android.os.Handler.handleCallback(Handler.java:873)
    8. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at android.os.Handler.dispatchMessage(Handler.java:99)
    9. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at android.os.Looper.loop(Looper.java:214)
    10. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at android.app.ActivityThread.main(ActivityThread.java:7050)
    11. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at java.lang.reflect.Method.invoke(Native Method)
    12. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
    13. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
    14. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.Interceptor" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.mncgames.play.kikorun-vyq_Idasv6jdshvj_BYk7w==/base.apk"],nativeLibraryDirectories=[/data/app/com.mncgames.play.kikorun-vyq_Idasv6jdshvj_BYk7w==/lib/arm64, /data/app/com.mncgames.play.kikorun-vyq_Idasv6jdshvj_BYk7w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
    15. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
    16. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    17. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    18. 2022/04/18 10:33:49.823 23494 23840 Error AndroidRuntime   ... 10 more
    Could you tell us how to solve these errors? Thanks
     
  32. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,

    Please check this complete project with all advertisers already integrated and compare it with yours:
    https://github.com/gleygames/MobileAds-Unity2020LTS-AllAds

    You should see there what libraries should be kept from Vungle in order to work.
     
  33. mncgames

    mncgames

    Joined:
    Nov 28, 2018
    Posts:
    6
    Hello,

    Thanks for the updates. When we clone the project, we encounter some errors when building the project. photo6285237317308362497.jpg

    Could you tell us what version the gradle should be and how to solve these errors? Thanks
     
  34. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
  35. mncgames

    mncgames

    Joined:
    Nov 28, 2018
    Posts:
    6
    Hello,
    We are having an issue where the ads network could not return any ads(the response has "no fill"). Are there any solution to this problem?

    we are only able to receive the response once, but after that it always return with "NO_FILL".

    And why do admob ads not appear in debug? (refer to the images below)
    Gley Ads problem (3).PNG Gley Ads problem (2).PNG )
    Gley Ads problem.PNG

    Thx
     
  36. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello!
    Your error indicates that your app should be enrolled firstly in a release (internal/close/open test or published) in the Google Play Console/ App Store. So please create one and test it via tester's link.
     
  37. mncgames

    mncgames

    Joined:
    Nov 28, 2018
    Posts:
    6
    Hello,
    our games have been lagging because Ads were requested repeatedly. How can we stop requesting ads from the script? Thx
    Gley Ads problem.PNG
     
  38. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Use Custom[AdvertiserName].cs and set the retry count to 0
     
  39. ahmedfahmed161992

    ahmedfahmed161992

    Joined:
    Jun 2, 2022
    Posts:
    1
    Assets\GoogleMobileAds\Editor\GleyAdmobPatch.cs(15,60): error CS0117: 'GoogleMobileAdsSettings' does not contain a definition for 'Instance'

    I want a solution to my problem
     

    Attached Files:

  40. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello! I have already replied on the support email. Check it out.:)
     
  41. jasonjakhun

    jasonjakhun

    Joined:
    Jun 12, 2022
    Posts:
    3
    any solution please ,.NB,./+%MP¨*#1231#°09876
    did you fix it please
     
  42. jasonjakhun

    jasonjakhun

    Joined:
    Jun 12, 2022
    Posts:
    3
    what is the solution please
     
  43. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
  44. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I got this errors after installing the IronSource SDK:

    Screenshot 2022-06-16 091211.png

    Prior to this I've installed admob and unity ads with no problems.
     
    Last edited: Jun 16, 2022
  45. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Well, as the error says, there are duplicates in your project. Go to Assets/ExternalDependencyManager/Editor and delete all duplicate files:
    i.e. Google.JarResolver.dll and Google.JarResolver_v1.2.169.dll are the same file, delete one of them.
    I recommend to delete the files without the version (the simple names). Do that for all duplicates in that folder and that the error says about.
     
  46. tousan

    tousan

    Joined:
    Feb 10, 2020
    Posts:
    3
    Admob works fine with Android, but when I change to iOS, the ads not show, and it turns out that USE_ADMOB is not defined, please help.
     
  47. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Please send the steps you took to reproduce your scenario.
    Make sure you press save in the Gley Settings Window. I know it sounds obvious, but it is a common mistake.
    Follow this tutorial:
     
  48. tousan

    tousan

    Joined:
    Feb 10, 2020
    Posts:
    3
    Thx, after several times uncheck and recheck iOS, it starts to works. But I have another question, call ShowRewardedVideo at the first time seems never show ads no matter how long I wait, every second try works fine, any idea?
     
  49. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Well, it should work as intended, so no time to wait before it appears any time (including the first time).
    1.I suggest you to test the TestAds scene included in the package and compare it with your implementation.
    2.Did you check on a real device? Enable debug mode from the Gley settings window and send the captures with the tryouts (gley.assets@gmail.com).
     
  50. rakeshmali

    rakeshmali

    Joined:
    Jan 6, 2015
    Posts:
    1
    hey i buying this plugin add all thing step by step but I am not creating APK Build pls solve this problem (Everything is ok SDK , NDK Also Android 11.0 api level 30 using
     

    Attached Files: