Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 8    Views: 242

mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
11/14/13 04:35 PM (10 years ago)

JSON snippet data not updating completely

can anyone tell me why these lines are not working? includeAds, listRowSelectionStyle also is it possible to have two itemTypes? i also want to add a header image to this JSON snippet but simply adding "imageFileName":"App-Header-1536-x-720_V5.png", doesnt bring the image to appear? { "itemId": "2437673B521AC4D764816CB", "itemType": "Ak_add_to_favourites", "itemNickname": "My Program", "navBarTitleText": "My Program", "listRowBackgroundColor": "#FFFFFF", "listRowSeparatorColor": "#D45450", "listBackgroundColor":"#D45450", "listRowSelectionStyle": "none", "listRowHeightSmallDevice":"60", "listTitleFontSizeSmallDevice":"14", "includeAds":"1", "listStyle": "round" }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/14/13 08:05 PM (10 years ago)
"includeAds" is an option that must be both in the BT Control Panel (and yours is) as well as in the plugin. However, it's for use with iAds. If you don't have apple's iAds in your app, it's not going to matter. "listRowSelectionStyle" as 'none' will give you the default behaviour for the menu that you're using. Usually the default is 'Blue'. Try choosing 'Grey' and see if that makes a difference. You cannot have two itemTypes for one plugin; the plugin must incorporate an image in it if that's what you want/need to do. If you're working with a menu, try Susan's 'Menu With Image' or Chris1's "Menu with Image Advanced". Cheers! -- Smug
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
11/15/13 01:21 AM (10 years ago)
Here's some example json for the full list iof options in the favourites plugin. I thought I'd added the iad option, but may ahve ommitted it from the code, it only requires a couple of lines of code. {"itemId":"09DB1AE759E064198ED42AD", "itemType":"Ak_add_to_favourites", "itemNickname":"Favourites123", "navBarTitleText":"hello", "navBarBackgroundColor":"#000000", "navBarStyle":"solid", "listBackgroundColor":"#99FF00", "listRowBackgroundColor":"#FF0033", "listTitleFontColor":"#0066FF", "listStyle":"plain", "listRowSeparatorColor":"#3399FF", "menuTransitionType":"fade", "listRowHeightSmallDevice":"100", "listTitleFontSizeSmallDevice":"20", "listHeaderHeightSmallDevice":"100", "listFooterHeightSmallDevice":"100", "listRowHeightLargeDevice":"200", "listTitleFontSizeLargeDevice":"40", "listHeaderHeightLargeDevice":"200", "listFooterHeightLargeDevice":"200", "loginRequired":"1", "hideFromSearch":"1", "includeAds":"1"}
 
mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
like
11/19/13 03:55 PM (10 years ago)
Thanks @smugwimp and @kittsy @kittsy are you please able to give the example on how to add iad, then i can replicate it for further options like eg. backgroundImage etc @kittsy is there a way to stop the little plus icon appearing in some of my custom_html plugin pages? i add your favourites plugin to custom_html but i dont want it there for all?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/19/13 04:06 PM (10 years ago)
If a plugin is not taking advantage of iAds, and you want it to, you need to alter the plugin 'index.php' file, which sets up the control panel options. Add this in an appropriate spot: <!-- ##################################################### --> <!-- ############### start iAd properties ################ --> <div class='cpExpandoBox colorLightBg'> <a href='#' onClick="fnExpandCollapse('box_includeAds');return false;"><img src='<?php echo APP_URL;?>/images/arr_right.gif' alt='arrow' />iAd Advertising Option (iOS only)</a> <div id="box_includeAds" style="display:none;"> <div style='padding-top:10px;'> <b>Include Advertisements on this Screen</b><br/> <select name="json_includeAds" id="json_includeAds" style='width:250px;'> <option value="0" <?php echo fnGetSelectedString("0", fnGetJsonProperyValue("includeAds", $jsonVars));?>>NO, do not include advertisements.</option> <option value="1" <?php echo fnGetSelectedString("1", fnGetJsonProperyValue("includeAds", $jsonVars));?>>YES, include advertisements.</option> </select> </div> <div style='padding-top:5px;'> <input type='button' title="save" value="save" align='absmiddle' class="buttonSubmit" onClick="saveAdvancedProperty('saveResult_includeAds');return false;"> <div id="saveResult_includeAds" class="submit_working">&nbsp;</div> </div> </div> </div> <!-- ############### end iAd properties ################## --> <!-- ##################################################### --> And then, in the plugin implementation file (the '.m' file) put this in your 'viewWillAppear': //show adView? if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]){ [self showHideAdView]; } Cheers! -- Smug
 
mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
like
11/22/13 06:48 PM (10 years ago)
thanks SmugWimp you are awesome. Il have a go.
 
mishgolf
Aspiring developer
Profile
Posts: 98
Reg: Nov 02, 2012
Sunshine Coast,...
980
like
11/23/13 01:31 PM (10 years ago)
Hi Smug, i dont where to find the index.php which suggests i probably shouldnt touch it just yet. What i really what to do is add a backgroundImage to My Programs page. is adding the code for this the similar as what you said for the iAd? ie needing to change the index.php? i am not self hosted, would this make it possible to find the php?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/23/13 02:10 PM (10 years ago)
The index.php (slated for retirement) is located in the root directory of each plugin. If you're not self hosted, you won't have access. However it's not needed for BT v3.0; you can manually change the json in the control panel now. Cheers! -- Smug
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
11/24/13 01:23 PM (10 years ago)
Sorry for the late reply smug was half right you need to create the advert view as well as show it. so at the bottom of the viewDidLoad method put [self createAdBannerView]; and at the bottom of the viewWillAppear method put [self showHideAdView]; I have not added the if statements as it appears that you will want the ads to show, this way you will not need to edit any json.
 

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.