Skip to content

"viewcontroller" no longer provided to AdMob custom event adapter requestAdWithSize() #78

@andre-arsenault

Description

@andre-arsenault

Hello. I am upgrading from iOS SDK 3.5.4 to 3.6.1 and during testing I discovered that there has been a breaking change to Custom Event Adapters on iOS and my Google AdMob adapter would no longer display banner ads.

The issue is that viewcontroller is no longer part of the NSDictionary parameter passed to Custom Event Adapter's requestAdWithSize() method. This results in the AdMob GADRequest failing with the following error:

<Google> You must set the rootViewController property of <GADInternalBannerView: 0x103364250; frame = (0 0; 320 50); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x283d79f20>> before loading a request.

Inspecting contents of the NSDictionary showed that the parent entry is an instance of MobFoxAd, so as a work-around, passing that object to GADBannerView.rootViewController seems to work just fine. Is this your new recommended solution?

For completeness here is the contents of the NSDictionary being passed to the Custom Event Adapter's requestAdWithSize() method as of iOS SDK 3.6.1:

{
    "adspace_height" = 50;
    "adspace_width" = 320;
    "c_customevents" = 1;
    "c_mraid" = 2;
    "dev_js" = 1;
    "o_iosadvid" = "D07DFB30-3252-4273-BCF6-4597AA759BC1";
    parent = "<MobFoxAd: 0x103b2fde0; frame = (47 686; 320 50); layer = <CALayer: 0x280381860>>";
    rt = "iphone_app";
    s = 9d46ae5307027e30b77fc88046f8a084;
    skip = 0;
    "sub_bundle_id" = "com.snowleopardgames.lifetotal";
    subid2 = LifeTotal;
    subid3 = "com.snowleopardgames.lifetotal";
    subid4 = "2.0.0";
    u = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57";
    v = "3.6.1_core";
}

And the same dictionary using iOS SDK 3.5.4:

{
    "adspace_height" = 50;
    "adspace_width" = 320;
    "c_customevents" = 1;
    "c_mraid" = 2;
    "dev_js" = 1;
    "o_iosadvid" = "D07DFB30-3252-4273-BCF6-4597AA759BC1";
    parent = "<MobFoxAd: 0x1051466e0; frame = (47 686; 320 50); layer = <CALayer: 0x2839e06a0>>";
    rt = "iphone_app";
    s = 9d46ae5307027e30b77fc88046f8a084;
    skip = 0;
    "sub_bundle_id" = "com.snowleopardgames.lifetotal";
    u = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57";
    v = "3.5.4_core";
    viewcontroller = "<MainViewController: 0x1051094b0>";
}

Assuming this isn't a bug, please take care to address breaking issues such as this in future release notes. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions