Admob Unity Plugin - Mute interstitial ads
Hey guys I am really hoping for some help on this one. In my game I have a button that once pressed mutes all sound and music. I have monetized my game with Google Admob and I am using the official Admob Unity Plugin. My problem is that when an interstitial is shown it is not muted. I want to mute my ads when my game is muted. Can anyone help me accomplish this?
My script for displaying ads looks like this:
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
public class AdmobScript : MonoBehaviour {
private static string interstitialId;
private static InterstitialAd interstitial;
private static AdRequest interstitialRequest;
public static int counter;
void Awake()
{
DontDestroyOnLoad(gameObject);
}
void Start ()
{
#if UNITY_ANDROID
interstitialId = "ca-app-pub-1518441074738585/3382052954";
#elif UNITY_IPHONE
interstitialId = "ca-app-pub-1518441074738585/2544448158";
#else
interstitialId = "unexpected platform";
#endif
counter = 0;
requestInterstitial ();
}
public static void requestInterstitial()
{
interstitial = new InterstitialAd (interstitialId);
interstitialRequest = new AdRequest.Builder ().TagForChildDirectedTreatment(true).Build ();
interstitial.LoadAd (interstitialRequest);
}
public static void showInterstitial()
{
if (interstitial.IsLoaded())
{
interstitial.Show ();
}
}
public static bool isAdReady()
{
return interstitial.IsLoaded ();
}
}
Comment
Answer by OttoClausen · Oct 09, 2018 at 11:14 AM
It was not possible back then. I don't know if it is now.
Your answer
Follow this Question
Related Questions
AdMob Plugin doesnt work in any case 1 Answer
Unity Admob Interstitial shows errors? 0 Answers
Problem playing AdMob 1 Answer
Unity Interstitial problem 1 Answer
Help with AdMob interstitials 0 Answers