Hide iAd until Ad is ready
I've just gotten my first app with iAds rejected from Apple because the iAd block needs to be disabled when no ads are being displayed. I have modified the TiUIiOSAdView.m file referenced here:
http://github.com/appcelerator/titanium_mobile/commit/782d970f785fd3cb3bfe4fbfdb479089b9aa2869
[self.proxy replaceValue:NUMBOOL(NO) forKey:@"visible" notification:YES];
But the iAd still appears when no network is available (Airplane Mode). I must be missing something else? Anyone have some advise?
9 Answers
-
I found out the iAd view hides itself in the simulator but not on my iPod Touch 2G. I'll re-submit it and see what Apple says.
-
Karlo - As far as I'm aware there is no 1.3.3 so it would have been submitted with 1.3.2.
I would also like to know what to do with this. I submitted a update with iAds last week with out the "fix" in it so I'm assuming its going to get rejected.
I placed the fix in the app and ran it but do not notice any difference, I still get the white box when there is no network connection.
-
Are you able to detect a network connection with Ti.Network and manually hide iAds?
-
@Kevin
I think apple wants it to go away when there server will not display an ad on the end user. I don't think it really matters to them if there is no network connection. I will see if they reject my app based on this same issue. It's at the review stage right now.
-
I just had my app rejected by apple because of this. They tell me to add the code from the error handling section on this page https://developer.apple.com/iphone/prerelease/library/documentation/UserExperience/Conceptual/iAd_Guide/WorkingwithBannerViews/WorkingwithBannerViews.html
I submitted a update using the code from http://github.com/appcelerator/titanium_mobile/commit/782d970f785fd3cb3bfe4fbfdb479089b9aa2869
I saw it work a few times in the simulator but never on the phone.
Does anyone have a answer on what we should be using to fix this problem?
Thanks
-
what about this?
Add load event to createAdView, and show it if it does. It seems to response to load event, anyone from TI care to comment how iad works?
-
Just got word, an upgrade to my iphone app with iAd integration approved! :)
It was built with 1.3.2 and updated with http://github.com/appcelerator/titanium_mobile/commit/782d970f785fd3cb3bfe4fbfdb479089b9aa2869
I also add load event ( i mentioned below) to show the view container which contain the iAd object, i was shooting in a dark but got approved anyway. :)
-
My app has also been approved using the Titanium 1.4 SDK and the following event listener code for my iAd's
var win = Titanium.UI.createWindow(); iads = Ti.UI.iOS.createAdView({ width: 'auto', height: 'auto', top: -100, borderColor: '#000000', backgroundColor: '#000000'}); t1 = Titanium.UI.createAnimation({top:0, duration:750}); iads.addEventListener('load', function(){ iads.animate(t1); }); win.add(iads);
-
Thanks for the info. Please update any new findings :-)