Quantcast
Channel: Questions in topic: "ads"
Viewing all articles
Browse latest Browse all 1416

Admob works on an empty project but not on my actual project

$
0
0
I have been trying to get Admob to work on my game now for weeks, this is causing me soo much hassle it's got to the point where I am seeking help. I have looked at countless posts on intergrating Admob and no one has a solution for me. I have tried Admob on 2 projects, my actual project (Not working) and on an empty project (Working). Both have the exact same code. Code: using System.Collections; using System.Collections.Generic; using UnityEngine; using GoogleMobileAds.Api; public class AdManager : MonoBehaviour { private BannerView bannerView; [SerializeField] private string appID = "..."; [SerializeField] private string bannerID = "..."; [SerializeField] private string regularID = "..."; private void Awake() { MobileAds.Initialize(appID); ShowBanner(); ShowAd(); Debug.Log(PlayerPrefs.GetInt("Number of Attempts")); Debug.Log(PlayerPrefs.GetString("No Ads")); } public void ShowBanner() { Debug.Log("Showing banner..."); this.RequestBanner(); } public void ShowAd() { Debug.Log("Showing regular ad..."); this.RequestRegularAD(); PlayerPrefs.SetInt("Number of Attempts", 0); } private void RequestRegularAD() { InterstitialAd AD = new InterstitialAd(regularID); AdRequest request = new AdRequest.Builder().Build(); AD.LoadAd(request); AD.Show(); } private void RequestBanner() { bannerView = new BannerView(bannerID, AdSize.Banner, AdPosition.Bottom); AdRequest request = new AdRequest.Builder().Build(); bannerView.LoadAd(request); bannerView.Show(); } } I have logged playerprefs and playerprefs are fine, I have the correct ID's, code is the same as the one on empty project, I have the script attached to an object, I have imported the same versions of the API's on both projects. Now I have literally ran out of ideas to what could be wrong. I am especially curious whether someone else has had a similar problem before and how they managed to fix it.

Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>