Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SoundGuy32 · Sep 11, 2010 at 04:34 PM · iphoneobjective-ciad

iAd in Unity 1.7

Hey,

i'm trying to put iAd into my unity 1.7 basic game all my forum searches yeild that there's a plug in for unity 3, but i want to get iad running on my game in the curent stable release of 1.7.

i'm trying to follow the instructions in the iAd programming guide by apple and i don't really understand objc and whats' goign on enough to do it. there's something about attaching it to a view when i try to put the code in the AppController :

ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];

adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50; [self.view addSubview:adView];

i get a compile error: 2.6.1/Classes/../../Assets/Editor/OpenFeint/Xcode/AppController+OpenFeint.mm:658: error: request for member 'view' in 'self', which is of non-class type 'AppController*'

can anyone help? does anyone have a running code for 1.7 basic that they can share?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Peter G · Sep 11, 2010 at 05:17 PM 0
Share

AppController is not actually a view controller, it creates one at runtime so self.view does not exist because self is an instance of AppController which is a child of NSObject, not ViewController. You need to find the instance of ViewController and add a subview to that.

avatar image Peter G · Sep 12, 2010 at 02:23 AM 0
Share

After a LITTLE poking around, it appears that the player just adds the Unity view directly to the Window in the OpenEAGL_UnityCallback method. Now, that is just from looking over the file and picking out some things so I can't guarantee it.

avatar image SoundGuy32 · Sep 12, 2010 at 02:45 AM 0
Share

ok - so how do i access the unity view from the openfeint appcontroller?

avatar image Peter G · Sep 12, 2010 at 12:26 PM 0
Share

It's tricky. I would look at this page for some guidance. http://technology.blurst.com/a-cocoa-based-frontend-for-unity-iphone-applications/

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Baby Ninja Developer · Nov 16, 2010 at 06:40 AM

Condition is getting no error message after installation (buid->append) and patching! In my case OF was installed before and was running good.

If you are working with OF and the iAd Plugin in Unity... a easy solution to run OF and iAd you can do following steps:

-Uncomment in AppController.mm the header file like this:

//#import "InGameAdViewController.h"

-Uncomment in AppController.mm Function applicationDidFinishLaunching:(UIApplication*)application like this:

printf_console("-> applicationDidFinishLaunching() AppController.mm\n");
[self startUnity:application];
//adViewController = [[InGameAdViewController alloc] init];
//adViewController.appController = self;
//UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
//[keyWindow addSubview:adViewController.view];
//[keyWindow bringSubviewToFront:adViewController.view];

-Copy the uncommented 5 lines above

-Go to AppController+OpenFeint.mm and import the header file like this:

#import "InGameAdViewController.h"

-Go to Function didFinishLaunchingWithOptions (in AppController+OpenFeint.mm)

-Paste the copied lines before and it should run

In my case it works now

My Software: OF2.6 | Unity iPhone Prof 1.7 | iAd Plugin 1.6.1 | Base SDK 4.1 | Targeting 3.2

Attention, i think it don`t work on iPad, there come a error, so if you design for both devices you must weak against the framework iAd.framework

Hope it helps anybody!!!

www.baby-ninja.com

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

iOS iAd causing hiccups on load 1 Answer

Attempt at using plugins for iphone 0 Answers

How do I enable iAds on my unity game for iPhone? 0 Answers

Transparent background 2 Answers

Mix native Objective-C code and Unity3d 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges