- Home /
Confused about iAD implementation
So in the docs, this is the only example code:
private ADBannerView banner = null;
void Start()
{
banner = new ADBannerView(ADBannerView.Type.Banner, ADBannerView.Layout.Top);
ADBannerView.onBannerWasClicked += OnBannerClicked;
ADBannerView.onBannerWasLoaded += OnBannerLoaded;
}
void OnBannerClicked()
{
Debug.Log("Clicked!\n");
}
void OnBannerLoaded()
{
Debug.Log("Loaded!\n");
banner.visible = true;
}
So what do I do? Add this to a game object in my scene and ads will just "work"? Do I just switch the game object on and off to hide/show ads? The docs are less than helpful...
Answer by POLYGAMe · Feb 13, 2014 at 09:56 PM
Okay, wow... it really is that simple! Add the script to an empty game object and you're away! Only becomes visible on device, not in editor.
I added this script to an empty game object of my main game scene and I keep getting the following error: Unexpected Token ADBannerView
Well it's not a complete script on its own. Did you create and appropriately name a c# script and add the code to it?
I ended up getting it working after buying the iOS Native plugin!
Glad it works for you but the Unity provided code works too.
I constantly get a white bar when using iAds on device. Did you experience this too? I've got no idea why this is happening.
Your answer
Follow this Question
Related Questions
iAd without plugins for iOS? 0 Answers
IAds Banner help. If IAds isn't showing show admob. 1 Answer
iAds scripting problem 0 Answers
How to implement iAd Banner correctly 0 Answers
google ads not showing on ios 0 Answers