Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 69

Janeen
Aspiring developer
Profile
Posts: 51
Reg: Jun 11, 2013
Southern Califo...
6,910
08/25/14 04:18 PM (10 years ago)

Interactive quiz: A way to enable iAds?

I don't see a setting in the control panel to enable iAds in the Interactive Quiz (aka bt_screen_quiz). Is there a way to do this? To confirm…this is the original free Interactive Quiz, not the advanced one. I've searched for a forum thread and googled it, but haven't come up with anything. Thanks! Janeen
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
08/25/14 08:01 PM (10 years ago)
You might be able to add the JSON to turn on the ads manually.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
08/25/14 08:04 PM (10 years ago)
"includeAds": "1"
 
Janeen
Aspiring developer
Profile
Posts: 51
Reg: Jun 11, 2013
Southern Califo...
6,910
like
08/26/14 12:28 AM (10 years ago)
Oh thanks, nadthevlad! I will give it a try.
 
Janeen
Aspiring developer
Profile
Posts: 51
Reg: Jun 11, 2013
Southern Califo...
6,910
like
08/26/14 12:35 AM (10 years ago)
Update: I added "includeAds": "1" to the JSON for the Interactive Quiz screen and it succeeded in putting the banner rectangle at the bottom of the quiz - but the rectangle is not populated with the test ad. I'm thinking there is more code that needs to be dropped in somewhere. Does anyone have an idea? Thanks!
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
08/26/14 06:26 AM (10 years ago)
Your testing on the device? I would check that you have the right permissions and certificates in your developer account, itunes connect, and xcode. There is also the ad framework that needs added to the project in xcode.
 
Janeen
Aspiring developer
Profile
Posts: 51
Reg: Jun 11, 2013
Southern Califo...
6,910
like
08/26/14 06:39 AM (10 years ago)
Yes, I'm testing on a device. I also have the Advanced Quiz plugin in my app and iAds is turned on and working there. I successfully tested it on my device. I'm studying/searching the Advanced Quiz .m and .h files to see what iAd code there might be that should be added to the Interactive Quiz files. I only found one snippet, and when I put it in it has a syntax error in it. Curious. But I'm not even sure I'm chasing this down the right rabbit hole. I'm just doing the trial and error thing right now. Here's the snippet I found in the Advanced Quiz .m file, which I pasted into the Interactive Quiz .m file: //create adView? if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]) { [self createAdBannerView]; } xCode doesn't like the "if", says it expects an "(" or an identifier. Again, I'm not even sure if successfully dropping the snippet in would do it, but I was giving it a try. Janeen
 
Janeen
Aspiring developer
Profile
Posts: 51
Reg: Jun 11, 2013
Southern Califo...
6,910
like
08/26/14 02:54 PM (10 years ago)
Okay, I figured out the solution to dropping a bit of code in so that you can enable iAds in the Interactive Quiz plugin, which is the free quiz plugin. 1. As nadthevlad suggested above (many thanks), go to the Interactive Quiz control panel. At the bottom, within the JSON window, paste the following at the bottom of the list: "includeAds": "1" This should be just above the } 2. Within xCode, open the file called BT_screen_quiz.m. It's in the bt_screen_quiz plugin folder. Search for "//transition question". It should be around line 790. Just below the "[self transitionQuestion];" paste the following: //create adView? if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]) { [self createAdBannerView]; } 3. Clean and build on an actual device. Make sure you refresh the app when it loads. When you test it, the iAds will appear at the bottom. (You must already have iAds set up in iTunes).
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.