mobfox / MobFox-iOS-SDK

Apache License 2.0
15 stars 12 forks source link

No ads with version 3.4.0 #65

Closed andre-arsenault closed 6 years ago

andre-arsenault commented 6 years ago

Hello. I just upgraded from 3.3.0 to 3.4.0 and I am no longer getting any ads during my testing.

For my upgrade process, I did the following:

Here's a log from my app with the 3.3.0 SDK:

2018-03-07 14:10:08.788683+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin >> showBanner 2018-03-07 14:10:08.788733+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin >> createAndLoadBanner(5a4c16612c0a289489e91b9c37a2cbc1) 2018-03-07 14:10:08.788744+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin: position: bottom-center 2018-03-07 14:10:08.788753+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin: bannerWidth: 320 2018-03-07 14:10:08.788760+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin: bannerHeight: 50 2018-03-07 14:10:09.220293+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin >> loadBannerContent 2018-03-07 14:10:09.221357+0100 LifeTotal[704:313477] Starting refresh timer (30secs) 2018-03-07 14:10:09.430807+0100 LifeTotal[704:313711] Metal GPU Frame Capture Enabled 2018-03-07 14:10:09.434579+0100 LifeTotal[704:313711] Metal API Validation Enabled 2018-03-07 14:10:10.331590+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin >> unhideBanner 2018-03-07 14:10:12.310732+0100 LifeTotal[704:313972] WF: === Starting WebFilter logging for process LifeTotal 2018-03-07 14:10:12.311382+0100 LifeTotal[704:313972] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2018-03-07 14:10:12.311991+0100 LifeTotal[704:313972] WF: _WebFilterIsActive returning: NO 2018-03-07 14:10:12.562930+0100 LifeTotal[704:313477] MobFox Ad Request >>> : { adFormat = banner; "adspace_height" = 50; "adspace_strict" = 0; "adspace_width" = 320; autoplay = true; "banner_pos" = 1; "dev_js" = 1; "hide_mute" = true; "o_iosadvid" = "D07DFB30-3252-4273-BCF6-4597AA759BC1"; rt = "iphone_app"; s = 5a4c16612c0a289489e91b9c37a2cbc1; skip = ""; "sub_bundle_id" = "com.snowleopardgames.lifetotal"; type = waterfall; v = "Core_3.3.0_static_core"; } 2018-03-07 14:10:13.351238+0100 LifeTotal[704:313477] MobFox ad response: { customEvents = ( { class = Amazon; id = stack393247; parameter = b2ce9c95c3f94900a98802f3d47ad6e1; pixel = "http://nvirginia-callbacks.mobfox.com/customevent.pixel.php?h=5c974f47e7415a43d467defece9c617f&custom_event_id=stack393247"; }, { class = Conversant; id = stack393249; parameter = "675e31fc-3465-11e4-b31e-15f4fced7073"; pixel = "http://nvirginia-callbacks.mobfox.com/customevent.pixel.php?h=5c974f47e7415a43d467defece9c617f&custom_event_id=stack393249"; }, { class = Facebook; id = stack393248; parameter = "1379767115623780_1607430786190744"; pixel = "http://nvirginia-callbacks.mobfox.com/customevent.pixel.php?h=5c974f47e7415a43d467defece9c617f&custom_event_id=stack393248"; }, { class = Conversant; id = stack393250; parameter = "675e31fc-3465-11e4-b31e-15f4fced7073"; pixel = "http://nvirginia-callbacks.mobfox.com/customevent.pixel.php?h=5c974f47e7415a43d467defece9c617f&custom_event_id=stack393250"; }, { class = AdMob; id = stack393209; parameter = "ca-app-pub-9390556562087047/4857138571"; pixel = "http://nvirginia-callbacks.mobfox.com/customevent.pixel.php?h=5c974f47e7415a43d467defece9c617f&custom_event_id=stack393209"; } ); } 2018-03-07 14:10:13.356656+0100 LifeTotal[704:313477] dbg: ### Amazon: loadAd ### 2018-03-07 14:10:13.356739+0100 LifeTotal[704:313477] dbg: ### Amazon: networkID: b2ce9c95c3f94900a98802f3d47ad6e1 2018-03-07 14:10:15.274614+0100 LifeTotal[704:313477] dbg: ### AMAZON: >>> BANNER AMAZON: adViewDidLoad <<< 2018-03-07 14:10:15.278101+0100 LifeTotal[704:313477] dbg: ### MobFoxPlugin >> MobFoxAdDidLoad

You can clearly see the network response from the waterfall, it choosing the Amazon adapter and loading a (test) add successfully.

Now here's the equivalent log after the upgrade to 3.4.0:

2018-03-07 14:28:41.432179+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin >> showBanner 2018-03-07 14:28:41.432246+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin >> createAndLoadBanner(5a4c16612c0a289489e91b9c37a2cbc1) 2018-03-07 14:28:41.432258+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin: position: bottom-center 2018-03-07 14:28:41.432266+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin: bannerWidth: 320 2018-03-07 14:28:41.432274+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin: bannerHeight: 50 2018-03-07 14:28:42.293722+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin >> loadBannerContent 2018-03-07 14:28:42.909536+0100 LifeTotal[724:320150] Starting refresh timer (30secs) 2018-03-07 14:28:43.154044+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin >> unhideBanner 2018-03-07 14:28:43.920712+0100 LifeTotal[724:320150] dbg: ### MobFoxPlugin >> MobFoxAdDidFailToReceiveAdWithError: Error Domain=MobFoxJSContext Code=1 "No Ad Available" UserInfo={NSLocalizedRecoverySuggestion=No Ad Available, NSLocalizedDescription=No Ad Available, NSLocalizedFailureReason=No Ad Available} 2018-03-07 14:28:43.923206+0100 LifeTotal[724:320467] MobFox wf request >> dealloc

No request/response for the waterfall, no attempt to hit any of my custom event adapters. If I modify MobFoxPlugin.m to use the test inventory hash, it will serve a test MobFox banner. Modifying any custom event adapter to try to serve test ads for that network (ie. Amazon or AdMob) will have no effect.

What's the deal? Is there a more involved upgrade process needed to get 3.4.0 to work? Are there any official release notes to help us out?

nabriski commented 6 years ago

Hi, It should work, we didn't change the interface or anything. Our tech support will test it with your hash (5a4c16612c0a289489e91b9c37a2cbc1) and see what's the problem.

Thanks

nabriski commented 6 years ago

Hi, Managed to fix this remotely. Please give it one hour to propagate through our system and try again.

Thanks

andre-arsenault commented 6 years ago

Thanks for the quick response! Your changes did enable me to receive a test ad for Amazon, but the app then crashed with the following call stack:

2018-03-07 18:42:53.734389+0100 LifeTotal[817:369170] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]' *** First throw call stack: (0x185c7f164 0x184ec8528 0x185c17c9c 0x185b4a8a0 0x185b5687c 0x100d4e954 0x186209d68 0x1862226bc 0x186655ba0 0x186595894 0x1865854c4 0x10194128c 0x10194d9e4 0x10194128c 0x10194d9e4 0x10194d8a4 0x186657878 0x10194128c 0x10194e678 0x10194cf08 0x1019529d0 0x1019526f4 0x1858a706c 0x1858a6b6c) libc++abi.dylib: terminating with uncaught exception of type NSException

Unfortunately not much to go on there. Here's a bit more of the log from before the crash, in case it helps:

3-07 18:42:49.801235+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin >> createAndLoadBanner(5a4c16612c0a289489e91b9c37a2cbc1) 2018-03-07 18:42:49.801245+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin: position: bottom-center 2018-03-07 18:42:49.801253+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin: bannerWidth: 320 2018-03-07 18:42:49.801260+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin: bannerHeight: 50 2018-03-07 18:42:50.250494+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin >> loadBannerContent 2018-03-07 18:42:51.180257+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin >> unhideBanner 2018-03-07 18:42:51.791089+0100 LifeTotal[817:369170] MobFox wf request >> dealloc 2018-03-07 18:42:51.853541+0100 LifeTotal[817:368956] dbg: ### Amazon: loadAd ### 2018-03-07 18:42:51.853606+0100 LifeTotal[817:368956] dbg: ### Amazon: networkID: b2ce9c95c3f94900a98802f3d47ad6e1 2018-03-07 18:42:52.777363+0100 LifeTotal[817:369169] TIC Read Status [4:0x0]: 1:57 2018-03-07 18:42:52.777437+0100 LifeTotal[817:369169] TIC Read Status [4:0x0]: 1:57 2018-03-07 18:42:52.779562+0100 LifeTotal[817:369273] NSURLConnection finished with error - code -1002 2018-03-07 18:42:52.988765+0100 LifeTotal[817:368956] dbg: ### AMAZON: >>> BANNER AMAZON: adViewDidLoad <<< 2018-03-07 18:42:53.023916+0100 LifeTotal[817:368956] dbg: ### MobFoxPlugin >> MobFoxAdDidLoad 2018-03-07 18:42:53.158109+0100 LifeTotal[817:369170] Metal GPU Frame Capture Enabled 2018-03-07 18:42:53.181239+0100 LifeTotal[817:369170] Metal API Validation Enabled 2018-03-07 18:42:53.734389+0100 LifeTotal[817:369170] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[1]' *** First throw call stack: (0x185c7f164 0x184ec8528 0x185c17c9c 0x185b4a8a0 0x185b5687c 0x100d4e954 0x186209d68 0x1862226bc 0x186655ba0 0x186595894 0x1865854c4 0x10194128c 0x10194d9e4 0x10194128c 0x10194d9e4 0x10194d8a4 0x186657878 0x10194128c 0x10194e678 0x10194cf08 0x1019529d0 0x1019526f4 0x1858a706c 0x1858a6b6c) libc++abi.dylib: terminating with uncaught exception of type NSException

Thinking there might be other changes, I browsed the commits between 3.3.0 and 3.4.0. The only thing I noticed that might break is in commit 9f5fc84, where one of the entries in the customEventInfo dictionary passed to requestAdWithSize was renamed from viewcontroller_parent to viewcontroller. I made that same change in my custom event adapters but it had no effect on the crash.

(I also noticed that in the same commit, the GPS-related info was commented out in your adapters. Why is that?)

Any other suggestions for where I could look, or is this on your end?

Thanks!

nabriski commented 6 years ago

Not sure, where this is. Do you know what is the last line in your code or the custom event that gets executed before the crash? We can try to reproduce it here with your hash and the Amazon custom event.

nabriski commented 6 years ago

Hi again,

With your hash I'm getting AdMob custom events and with my Amazon app id I'm not getting any demand yet (and this case works). Do you have any MobFox hash configured to Amazon only that will get me an ad?

Thanks

andre-arsenault commented 6 years ago

Right, Amazon only serves ads in a select few countries. You need to enable Amazon test ads like this:

  AmazonAdOptions *options = [AmazonAdOptions options];
  options.isTestRequest = YES; // Turn on isTestRequest to load a test ad
  [self.amazonAdView loadAd:options];
andre-arsenault commented 6 years ago

In reference to your previous question, as far as I can tell, the last of my / custom event code executed before the crash is adViewDidLoad:

- (void)adViewDidLoad:(AmazonAdView *)view
{
  // NSLog(@"dbg: ### AMAZON: >>> BANNER AMAZON: adViewDidLoad <<<");
  [self.delegate MFCustomEventAd:self didLoad:view];
}

This doesn't seem to be present in the crash call stack though, so I think the crash occurs in another thread sometime later.

nabriski commented 6 years ago

I'm using the "test request" option but to no avail. Maybe because my Amazon app is not approved. Are you getting it by using this hash: 5a4c16612c0a289489e91b9c37a2cbc1? if so I will try to disable AdMob.

andre-arsenault commented 6 years ago

Yep, that's the app hash I'm using. Its mediation stack should always try to serve an Amazon ad first.

andre-arsenault commented 6 years ago

So I'm running the app again with literally the same build as last night, and now it's not crashing. It was 100% repro before, now everything is running great.

Were any more back-end changes made?

andre-arsenault commented 6 years ago

For the sake of history and completeness, I'm attaching the full core dump from one of the crashes.

Amazon Test Ad Crash.txt

nabriski commented 6 years ago

ok, thanks. No, there weren't any other back end changes. I still want to get an Amazon ad :) Will update If I get this crash. Maybe it has to do with the specific demand returned by Amazon.

andre-arsenault commented 6 years ago

Could be - thanks for continuing to follow up, it's much appreciated.

Do you have any comments on the modified contents of the customEventInfo dictionary in commit 9f5fc84, or the commenting-out of the use of the location-specific members of said dictionary in your custom event adapter code?

nabriski commented 6 years ago

Hi,

Yes, the modified contents needs to be updated in all custom events (it's a bug it wasn't). This will be updated next week. Commenting the location specific data was done on purpose as we expect each SDK to take the location by itself if it's available. We may change this again in the future.

andre-arsenault commented 6 years ago

Ok, thanks for the info! In the future, changes to customEventInfo would be worth mentioning in the release notes, for those of us with our own custom event adapters.

Closing this issue since everything is now working properly.

nabriski commented 6 years ago

Agreed, this will be done from now on starting from our next release.