Hi, I am using a thread to initialize admob to prevent lag caused by it initializing in the player script. But whenever I launch my app, it crashes.
void Start () {
Thread adThread = new Thread(new ThreadStart(bannerAdSetup));
adThread.Start();
}
public void bannerAdSetup()
{
Banner View bannerView = new BannerView(
"MyAdkey", AdSize.Banner, AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request);
}
Any ideas why this crashes?
Any help is greatly appreciated, thanks.
↧