Hi all,
Is Unity 3.0 capable of supporting IAds?
thanks
Hi all,
Is Unity 3.0 capable of supporting IAds?
thanks
as far as I know yes. I don’t know if it’ll be built into the unity API itself but since there’s going to be plugin support for both basic and advanced versions you should have access to iAd functionality either way.
Its not built in but you can add support for it if you want.
Adding it directly to unity would be pretty pointless, simply for the reason that iAd is OS4 only yet OS4 does not like 2nd gen devices that thanks to apple (who still sells second gen itouch as “cheap 8gb itouches”) or put differently: anyone installing os 4 on those WILL downgrade if he is capable of it, as the device becomes useless with os4 killing it ![]()
I know it’s not the point of the discussion, but my iPod touch 2nd Gen has been handling iOS 4.0 just fine.
I’m practically done with the iAd integration. Working out the bounds/frame landscape/portrait NIGHTMARE. And IT IS a nightmare!
Once I have this worked out, I’ll try to make an editor/post-process build integration, so we can all enjoy iAd without the hurts.
PS: By the way, anyone heard of ADRemoteViewController? It’s not in the docs and the console displays a message about it.
I believe ADRemoteViewController handles stuff when your app gets suspended. (Why display new ads when your app is in the background and nobody can see them?)
I got iAD working flawlesy in one of my non-unity apps. Make sure to deal with the callback functions though… I didn’t notice at first (test ads still work) and I didnt have any problems until after apple approved it. Then it crashed on start up because it did not know what to do when it did not receive an ad. I submitted the fix, and it’s working great!
I think the function is called didFailToRecieveAdWithError… Also take a look at the callback function for when an ad is loaded.
I just moved the iAd frame on or off screen depending if an ad was ready to be displayed with a pretty UI Animation.
Sorry if my grammar is terrible… I’m on my iPhone and it’s about 1:08 am.
I’ll post the code I used for my non - unity app if you think it would help… I’m eager to use it with my unity apps.
Jake
Oh yes please do post your code! Thanks
@Jake: Thank you for the tips. I did implement all the available/necessary methods.
Regarding ADRemoteViewController, if you have any kind of documentation on it, please feel free to post it up ![]()
@mohydine: That’s the idea! Either as straight-up code, or in the form of a plugin.
If anyone is familiar with manual view rotation, CGAffineTransforms, bounds, frames, etc… please PM me.
There’s a good conversation about iAds along with some helpful code by Kenlem posted on this thread:
The code I posted in that thread in only a small sample built with XCode that displays an iAd. It doesn’t implement all the required features and it doesn’t work with Unity. It might be interesting but I doubt it will be helpful.
Oh, too bad- I was looking forward to trying it! Thanks for the clarification.
Heres my Xcode code… Hope it helps someone somewhere…
- (void)viewDidLoad {
[super viewDidLoad];
bannerView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 50.0f);
bannerView.frame = CGRectOffset(bannerView.frame, 0, -50);
}
#pragma mark -
#pragma mark ADBannerViewDelegate methods
- (void)moveBannerViewOffscreen
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// assumes the banner view is at the top of the screen.
bannerView.frame = CGRectOffset(bannerView.frame, 0, -50);
[UIView commitAnimations];
}
- (void)moveBannerViewOnscreen
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
// assumes the banner view is at the top of the screen.
//bannerView.frame = CGRectOffset(bannerView.frame, 0, +50);
bannerView.frame = CGRectMake(0.0f, 0.0f, 320.0f, 50.0f);
[UIView commitAnimations];
}
#pragma mark -
#pragma mark ADBannerViewDelegate methods
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
[self moveBannerViewOffscreen];
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
[self moveBannerViewOnscreen];
}
Don’t forget to include the necessary frameworks and imports… etc…
I want to add iAd to my menu screen between levels. Will that be posible with this code?
Hey,
Jake’s posted code does not integrate iAd into Unity at all.
I’m currently finishing up the first version of my iAd plugin for Unity.
This version will allow you to set the ad banner to top or bottom of the game view. It isn’t scene-specific, which means it will run for all the scenes in your game.
I should be releasing some time this week. It is fully integrated into Unity, which means it will tie itself into your xcode project when you click File > “Build” from the Unity editor.
I am also considering charging for it ($3.99 is what I have in mind right now), as I have been spending a lot of time and effort getting the integration to be seamless and painless.
3.99 is worth for me.
Are you already selling the code?
Martin
http://www.dobesgames.com
Hey martdob,
Yes, the plugin is available on this thread:
http://forum.unity3d.com/viewtopic.php?t=57530
Hi, does it also works with App they are designed for iPhone and iPad?