I'm trying to implement AdGamer SDK in my Unity game. I'm calling AdGamer.InterstitialAds.Show() but it doesn't show anything. Please help
It could be for several reasons:
The interstitial hasn't yet been loaded. So, check AdGamer.InterstitialAd.IsReady() before trying to show an interstitial ad
The SDK hasn't yet been initialized. Make sure to call AdGamer.InitWithGameToken(YOUR_GAME_TOKEN); before calling anything else in the AdGamer SDK. For example, you can do that in Awake() method in a script which you put on some GameObject in the first scene your game loads. Or you could create a static method with the attribute [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
to make it run at game launch before anything else. It can be in any script and there you'd initialize the SDK. The game token you get when you register your game in the AdGamer publisher console.
The initialization of the SDK may take several seconds (e.g. it may need to auto-update), so if you're trying to show an interstitial very early (right at game launch, before the starting screen) the call will likely fail. For such cases you may want to check AdGamer.IsInitialized before doing anything else.
// in any script
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
public static void InitializeAdGamerBeforeEverything()
{
AdGamer.InitWithGameToken(YOUR_GAME_TOKEN);
}
// elsewhere in code
if (AdGamer.IsInitialized && AdGamer.InterstitialAd.IsReady())
{
AdGamer.InterstitialAds.Show();
}
There is no internet connection or some firewall or other settings on your machine prevent the game from connecting with AdGamer servers
Note that the "no_fill" case doesn't exist in AdGamer: it should return at least a cross-promo ad even if no commercial ad is available in your country at the moment.
Also, please be sure to check the SDK documentation (it also comes as a PDF file inside the unitypackage)
Related
I`m using "firebase_admob" package https://pub.dev/packages/firebase_admob
and my code is below
static void hideBannerAd() {
if (_bannerAd != null) {
_bannerAd.dispose();
_bannerAd = null;
}
}
All of my ads functions are defined as static and this works perfectly.
Currently I am turning off ads on my app's specific page.
However, since releasing my app, certain customers have found that hideBannerAd is not working properly.
On a particular page, they say that there are times when the ad is turned off well and sometimes it is not, once it is not turned off, it will never turn off(Even if they go in and out of that particular app's screen page) .
On my device this works perfectly without any of error.
If you turn off and turn on the AdMob banner frequently, is there a case where the network is tangled and it does not work properly?
Any advices would be appreciate
I had this problem on a project a while ago, this is a package bug. Here are a few similar unresolved GitHub issues : #96, #669, #3056, #3900. The package have been poorly maintained, but this might change due to the recent FluterFire reorganization.
Can I show ads from any ad network inside the Editor?
If not, then how do I check that the request was succesful in Editor? You can give an example from any SDK.
When using admob in the unity editor you can not actually view the real ad units or the test ad units. Unity will give you a log message saying that the ad was run, but it will not call the reward call back. You can implement platform specific code using
#if UNITY_EDITOR
your reward call back code goes here
#endif
this way you can trigger the reward call back in unity without watching the ad so the program will still function properly.
You must build the program to actually view the test ads and make sure all the callbacks are working.
Struggling with adding Crashalytics to our build.
We've downloaded and added the Fabric UnityPackage, upgraded to the latest version, signed in to our Fabric account from within the Unity Interface, and dragged the GameObject from the final step of the 'Prepare Fabric' modal into our first scene. Finally, we've built the game to Android.
After this, playing the game in the editor is prompting "Couldn't find Crashlytics GameObject" warnings, even though FabricInit and CrashlyticsInit are in the scene. The message pops up twice when running the game -- There are two consecutive Unity Scenes that this startup scene leads to.
There doesn't seem to be any specific documentation on the website, and the Fabric website leads us to the download page, as opposed to the dashboard.
Mike from Fabric here. The goal of this warning was to let you and other developers know that they haven't dragged in the CrashlyticsInit game object within a game, but this is being flagged in other cases due to how we try and detect this.
We're working on a more graceful way to get this point across, but in the meantime, if you comment out line 65 of Fabric/Editor/CommonBuild/FabricCommonBuild.cs then this will go away.
I removed the [PostProcessScene(0)] in Fabric/Editor/CommonBuild/FabricCommonBuild.cs
Because I only initialize and put the Crashlytics GameObject in my first scene.
I don't need it to check every scene to confirm if there is an object or if it needs to be initialized.
But still not sure if it will have some side effect.
I am working on a Unity game that needs to be monetized with Heyzap SDK. I integrated the latest SDK that had some issues earlier and its fixed.
Now I want to know whats the best possible way to preload or cache interstitial and reward ads before calling Show method.
In doc, it says, Fetch right after initializing Heyzap SDK.
What if I have 3 different placements in game ? ie, three different tagID's.
I know that I can make use of HZInterstitialAd.Fetch("tagID1") and so on...
I just want to know that I am doing it in the right way....
So these are my questions.....
1) I am calling HeyzapAds.Start("xxxxxxx") in Awake() of one of my cs scripts. Is Awake() the right function to initialize Heyzap SDK ?
2) Can I call Fetch method subsequently like below. Because I want all these 3 ads with different tagids to be preloaded or cached. Will it cause any network bottleneck because of the subsequent web service calls ? Is it safe to load Ads like this ?
HZInterstitialAd.Fetch(tag1)
HZInterstitialAd.Fetch(tag2)
HZInterstitialAd.Fetch(tag3)
3) In my game, as soon as the user launch the app or when user hard close ( remove from memory ) and launch the app again, I have to show an Ad ( bootup ad ). To achieve this, I used the below code, but it's not working. Could you let me know how to show bootup Ad or show an AD right after initializing Heyzap SDK.
Is there any delegate available to check if the SDK initialized before I attempt to call Show method or Should I rely on Fetch and its respective interstitial or incentivized delegates ?.
HZInterstitialAd.Fetch(tag1)
HZInterstitialAd.Fetch(tag2)
HZInterstitialAd.Fetch(tag3)
HZInterstitialAd.ShowWithOptions(option);
I also tried calling from Android's Activity's Resume and Start to Unity's function that trigger Heyzap interstitial Ad. But its not working either.
Note: If I attempt to call Show after a small pause say 1 or 2 seconds, all calls are working. It seems that calling Show right after initialization is not working. It needs some time to search and Fetch Ads from available networks ?. So whats the recommended approach to show BOOTUP Ad ?
For somehow I don't get Chartboost interstitial loaded every time, asked them and as most answers:"no more of the interstitials available at the time you're testing in the network satisfy the conditions......". So now I use revmob also. The question I have: how to check if Chartboost is preloaded? my code so far:
if(Chartboost.hasInterstitial(CBLocation.Default))
{
Chartboost.showInterstitial(CBLocation.Default);
}else {
revmob.ShowFullscreen();
}
I only receive revmob interstitials. Is my checking condition ok? Saw something about delegates but I am not sure how to use them.
Yes you checking condition is OK.
For using delegates read this Chartboost Documentation on delegates in Unity3D. I think it has a pretty good explanation on how to implement delegate methods. Also I will HIGHLY recommend that you do implement these delegate methods as they will help you not only with displaying ad status logs but also identifying problems regarding Ad display.
EDIT for future reference:
For example:
Implementing Chartboost.didCacheInterstitial and Chartboost.didFailToLoadInterstitial delegates will tell you if and when an interstitial ad was loaded or failed. The fail delegate(s) also sends an error as parameter so you would know why the cache was failed.
If the delegates are not being called then there is an issue with your chartboost SDK integration in your project inside unity. In that case try re-importing the chartboost sdk and check you chartboost dashboard for issues. One of the most common issues >> make sure that there is an active ad campaign linked to your in chartboost dashboard. To setup an ad campaign follow: Start a Publishing Campaign