Ads with AdMob

there is a way to integrate the ads of admob to a project XCODE ?

http://www.admob.com/

i try to change the file “xib” but nothing …

there is someone who has succeeded?

I talked to them a while ago and asked them if they can create some lib to be used in Unity as a lot of games get created with Unity. So far the answer was that they sent my request off to their engineers, but never heard back.

Integration their core lib would not work because the app would run in Open GL I guess, but I might be wrong.

then it is not a problem of unity !!!

ok … any way to make ads ?

Well no, of course it’s not a problem of Unity. Uhm, did I say that somewhere? Didn’t mean that.

Just wanted to say: I talked to the Admob people if they can make their stuff compatible to Unity so that we get a simple solution to display ads in Unity made iPhone games.

@Martin: what API Admob provides for iPhone right now? Do they have ObjectiveC/C++ APIs? (I couldn’t found anything usefull on their site without registering)

this project

114181–4381–$admob_iphone_sdk_20081106_938.tar (478 KB)

@ReJ: Yes, that’s what they told me (Objective-c lib). A simple to use library which can be plugged into existing code and which would then display the ads when called from code. I’m registered on the site and await soon my clearing to be able to download the SDK.

This would be great, especially for getting something back on free Lite versions.

Also, App Store customers are expecting quite a bit for 99 cents these days. I’m wondering how long indies will be able to compete in the paid app space. I’m hoping for a long while, but it’s getting pretty crowded in there.

Did anybody ever figure this problem out?

I’d be interested to know about how to integrate AdMob myself.

Thanks.

i think that if we can stop the load and do a first menu in xcode a later load unity game is a start …

this a thread of a video

http://forum.unity3d.com/viewtopic.php?p=120119#120119

or the solution is that

http://forum.unity3d.com/viewtopic.php?t=17859&highlight=keyboard

This would not be hard to implement at all. I can take a crack at it. Does AdMob have requirements about when the ads appear? Before and after the Unity engine runs would be simplest.

Edit: Actually, this looks really easy. Can someone PM me a publisher ID so I can test it?

Got it working. The ad refreshes every 15 seconds (crazy fast, I know, but I wanted to make it fast for testing).

Since the Unity keeps the phone in portrait orientation (while actually renderings its own view in a landscape orientation) the ad appears rotated along the side. At some point I’ll use a CGAffineTranform to rotate the ad.

Bravo sir!

you used my code ?

because I saw that there is an impression, but in Europe … strange

scinfu: I used my own publisher id code (and as you can see it’s in test mode anyway). And I’m not in Europe, sadly.

Even sadder is the fact that ad clicks switch to Safari instead of opening a WebKit view. My code is pausing and restarting the Unity engine when the AdMob API says it’s about to display or hide a modal view… which it never does.

Nice! Mind sharing your efforts how it was done?

Do you want code snippets, or something you can drop in and forget about? The later will require a PostProcessBuildScript because there’s code changes to be made.

The important part is:

    AdMobView *ad = [[AdMobView requestAdWithDelegate: selfController] retain];
    ad.frame = CGRectMake(0, 0, 320, 48);
    [_window addSubview:ad];
    _timer = [NSTimer scheduledTimerWithTimeInterval:(15.0) target: ad selector:@selector(requestFreshAd) userInfo:nil repeats:YES];

I retained the view because I don’t want it going away if the ad server doesn’t return an ad (which apparently it might do) but it’s probably not necessary. And obviously, change the timer interval to whatever works for you.

Oh, and of course, add the AdMob libraries and header files (and the CoreGraphics and CoreLocation frameworks) to the project in XCode.

You also need to define and set selfController.

Lots of little details. I’ll write up the little details later. Or maybe making a PPBS would be simper.

Very cool!! Thanks you! Maybe you could add this info to the wiki?

i looked at admob and don’t you get money if the user clicks the add, well don’t you need iphone advanced to open urls?

The Admob stuff is implemented in Objective-C, not Unity. It should work fine in Basic.