Git Product home page Git Product logo

Comments (11)

larsacus avatar larsacus commented on August 29, 2024

Did you clone and integrate the source yourself, or did you use cocoapods? It's very suspect that the warning you are referring to is output on line 508 and not line 521 as the warning you have pasted here specifies.

I'll need some more information to see if there is an issue. If you could, please place #define LARSADCONTROLLER_DEBUG somewhere in your *.pch file to enable logging, then copy/paste the full debug output.

from larsadcontroller.

igorcarrasco avatar igorcarrasco commented on August 29, 2024

Nothing seems to Appear:

2013-04-15 20:46:13.052 PinThis[5614:907] LARSAdController WARNING [line
521]: There are no registered ad network adapter classes. Please register
an ad network class using registerAdClass: before attempting to add ad
container view into your view heirarchy.
2013-04-15 20:46:23.866 PinThis[5614:907] To get test ads on this
device, call: request.testDevices = [NSArray arrayWithObjects:@"zzzzzzzzzzzz",
nil];
2013-04-15 20:46:24.670 PinThis[5614:907] Cannot find an ad
network adapter with the name(s): (
GADMAdapterIAd
). Remember to link all required ad network adapters and SDKs, and set
-ObjC -all_load in the 'Other Linker Flags' setting of your build target.

On Mon, Apr 15, 2013 at 4:50 AM, Lars Anderson [email protected]:

Did you clone and integrate the source yourself, or did you use cocoapods?
It's very suspect that the warning you are referring to is output on line
508 and not line 521 as the warning you have pasted here specifies.

I'll need some more information to see if there is an issue. If you could,
please place #define LARSADCONTROLLER_DEBUG somewhere in your *.pch file
to enable logging, then copy/paste the full debug output.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-16366317
.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

Are you using cocoa pods or did you clone the source and integrate yourself? It sounds like you didn't set the -ObjC and -all_load flags in your project for the AdMob framework.

from larsadcontroller.

igorcarrasco avatar igorcarrasco commented on August 29, 2024

Greetings,

I used the cocoapods.

I have those flags and a bunch of others set in My Project.
No flag is set in the Pods Project.

best regards

On Mon, Apr 15, 2013 at 11:04 PM, Lars Anderson [email protected]:

Are you using cocoa pods or did you clone the source and integrate
yourself? It sounds like you didn't set the -ObjC and -all_load flags in
your project for the AdMob framework.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-16414428
.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

If you're using cocoapods, you'll need to set the above #define in your pod's prefix.pchfile to get the logs to appear.

from larsadcontroller.

igorcarrasco avatar igorcarrasco commented on August 29, 2024

2013-04-16 01:34:44.308 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:34:44.312 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:34:44.315 PinThis[10380:907] LARSAdController WARNING [line
521]: There are no registered ad network adapter classes. Please register
an ad network class using registerAdClass: before attempting to add ad
container view into your view heirarchy.
2013-04-16 01:34:44.317 PinThis[10380:907] LARSAdController [line 717]:
Registering for orientation notifications
2013-04-16 01:34:44.318 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:34:44.320 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:34:44.470 PinThis[10380:907] LARSAdController [line 743]:
Handling orientation change
2013-04-16 01:34:44.790 PinThis[10380:907] LARSAdController [line 743]:
Handling orientation change
2013-04-16 01:34:44.827 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:34:44.829 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:34:44.839 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:34:44.840 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:36:09.327 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:36:09.329 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:36:09.331 PinThis[10380:907] LARSAdController [line 536]:
Creating new instance of adapter class "TOLAdAdapteriAds"
2013-04-16 01:36:09.333 PinThis[10380:907] LARSAdController [line 576]:
Successfully created instance of "TOLAdAdapteriAds"
2013-04-16 01:36:09.351 PinThis[10380:907] LARSAdController [line 487]:
Initial banner frame : {{0, 50}, {320, 50}}
2013-04-16 01:36:09.356 PinThis[10380:907] LARSAdController [line 187]:
View is portrait
2013-04-16 01:36:09.357 PinThis[10380:907] LARSAdController [line 210]:
Container frame: {{0, 366}, {320, 50}}
2013-04-16 01:36:19.870 PinThis[10380:907] LARSAdController [line 644]: Ad
loaded for iAds!
2013-04-16 01:36:19.878 PinThis[10380:907] LARSAdController [line 512]:
Final banner frame : {{0, 0}, {320, 50}}
2013-04-16 01:36:19.896 PinThis[10380:907] TOLAdAdapteriAds [line 107]: iAd
did load ad

On Tue, Apr 16, 2013 at 12:38 AM, Lars Anderson [email protected]:

If you're using cocoapods, you'll need to set the above #define in your
pod's prefix.pchfile to get the logs to appear.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-16418099
.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

Just looking at this short output, it appears your ads are running fine. The initial call to addAdContainerToViewInViewController: may be being called before you are registering the ads with the system. But that doesn't make sense if you are registering the ad adapters in application:didFinishLaunching:withOptions:. Ensure you are registering your ad adapters as soon as you can in application:didFinishLaunching:withOptions: and see if that helps. Where is the first place you are adding an ad to your views? It seems like it's only the initial call that's getting hung up.

from larsadcontroller.

igorcarrasco avatar igorcarrasco commented on August 29, 2024
  • (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    // Override point for customization after application launch.
    UIViewController *rootController =
    [[ViewController alloc]
    initWithNibName:@"ViewController" bundle:nil];

    navigationController = [[UINavigationController alloc]
    initWithRootViewController:rootController];

    self.window = [[UIWindow alloc]
    initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window setRootViewController:navigationController];
    [self.window makeKeyAndVisible];

    [[LARSAdController sharedManager] registerAdClass:[TOLAdAdapteriAds
    class]];
    [[LARSAdController sharedManager]
    registerAdClass:[TOLAdAdapterGoogleAds class] withPublisherId:@
    "xxxxxxxxxx"];

    return YES;
    }

Is it because I alloc my root view controller and add it to the
navigationcontroller before?

All my calls to the adcontroller are on:

  • (void)viewWillAppear:(BOOL)animated
    {
    [super viewWillAppear:animated];
    [[LARSAdController sharedManager]
    addAdContainerToViewInViewController:self];
    }

On Tue, Apr 16, 2013 at 3:27 AM, Lars Anderson [email protected]:

Just looking at this short output, it appears your ads are running fine.
The initial call to addAdContainerToViewInViewController: may be being
called before you are registering the ads with the system. But that doesn't
make sense if you are registering the ad adapters in
application:didFinishLaunching:withOptions:. Ensure you are registering
your ad adapters as soon as you can in
application:didFinishLaunching:withOptions: and see if that helps. Where
is the first place you are adding an ad to your views? It seems like it's
only the initial call that's getting hung up.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-16423289
.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

Yes. You are registering your ad adapters after you are creating your view controller and adding it to the window, which is trying to display an ad before it knows what ads it is supposed to display. Just move the call to register your ad adapters before any calls related to your view controller and you shouldn't have the issue anymore.

from larsadcontroller.

igorcarrasco avatar igorcarrasco commented on August 29, 2024

Thanks.

Btw I'm working in an App ATM that requires callback to when an ad is going
to display,going to hide.

Right now I made my own obervers:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(adWillShow)
name:@"adWillShow"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(adWillHide)
name:@"adWillHide"
object:nil];

And I'm trigering them:

  • (void)adSucceededForNetworkAdapterClass:(Class)class{

    [[NSNotificationCenter defaultCenter]
    postNotificationName:@"adWillShow"
    object:self];

  • (void)adFailedForNetworkAdapterClass:(Class)class{
    [[NSNotificationCenter defaultCenter]
    postNotificationName:@"adWillHide"
    object:self];

Is there a built in way to get notifications?

I found this in your code:
/** A boolean flag that indicates if any ads are currently being
displayed.
@discussion Value change will be triggered when any ads have a visibility
state change. Key-value observable.
*/
@Property (nonatomic,
getter = isAdVisible, readonly) BOOL adVisible;

But haven't found an example on how to implement it!
best regards

On Tue, Apr 16, 2013 at 2:16 PM, Lars Anderson [email protected]:

Yes. You are registering your ad adapters after you are creating your
view controller and adding it to the window, which is trying to display an
ad before it knows what ads it is supposed to display. Just move the call
to register your ad adapters before any calls related to your view
controller and you shouldn't have the issue anymore.


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-16443791
.

from larsadcontroller.

larsacus avatar larsacus commented on August 29, 2024

You can add what's called a key-value observer to watch the adVisible property for changes. I've included a key in LARSAdController.h, kLARSAdObserverKeyPathIsAdVisible, that you can use to observe this property. Whenever it's value changes, this means that the status of visible ads has changed.

The basics of KVO are:

Register observer:
[[LARSAdController sharedManager] addObserver:self forKeyPath:kLARSAdObserverKeyPathIsAdVisible options:NSKeyValueObservingOptionNew context:nil];

Observe changes by implementing in your observer:

- (void)observeValueForKeyPath:(NSString *)keyPath
                      ofObject:(id)object
                        change:(NSDictionary *)change
                       context:(void *)context
{
    if ([keyPath isEqualToString:kLARSAdObserverKeyPathIsAdVisible]) {
        //handle change here
    }
}

You can find more info about KVO here: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/KeyValueObserving/Articles/KVOBasics.html#//apple_ref/doc/uid/20002252-BAJEAIEE

from larsadcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.