Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 44

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
04/03/14 02:03 AM (10 years ago)

html/text caching, OK android, not OK ios

I am working on an app which is built for both Android and IOS. I'm using the custom html/ text plugin for some of the pages and I have noticed that sometimes those pages refuse to refresh in a timely manner on IOS. To be clear, it is the content that doesn't update, if I update the top navigation bar title, that updates immediately (as it should). If I make the edits to the text of the page, the control panel shows the updates - all good there. I then refresh the app manually, or the app detects a change from something else and prompts, I refresh. I check my iPhone but the edits don't show on my iPhone. On Android, I refresh all data on my device and the changes are there immediately, no problem. This behaviour has been reported before, but I am not aware of any solutions and it seems it hasn't gone away. I've noticed that if I delete the app from memory of my iPhone and start it again, then refresh, the the updates might eventually be taken, but then again, it might be a coincidence. Network connectivity is all good - I can't get my head why it is OK on Android but not on IOS. Any idea's anyone?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/03/14 02:39 AM (10 years ago)
Well, let's think about this for a second… I'm not sure why on Android and not on iOS, but the way I see it working would be two separate events… 1) The Buzztouch app configuration is loaded. 2) The new configuration is parsed. 3) The app is reloaded in accordance with the current configuration. did the plugin configuration change? If it did (filename, url, whatever) then I suspect the plugin will update. But if the filename in the plugin remains the same, and there is a copy of that filename in cache, it stands to reason the app might not bother looking for a new copy. You might think about having the plugin auto refresh the content when it loads, or set the plugin to refresh and not cache. I found this statement on line 266 of the 'BT_screen_customHTML.m' file: if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"forceRefresh" defaultValue:@""] isEqualToString:@"1"]){ if you change the default value to @"1" it will constantly refresh upon loading, providing the results you seek. We hope. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/14 02:46 AM (10 years ago)
Thanks for the idea Smug. If the plugin navbar title updates, but the content does not, then presumably a change has been detected?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/03/14 03:18 AM (10 years ago)
Hmm… lol! You would think… If you can, put this statement just after the 'initLoad' debugger statement: [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"Value of Force Refresh: %@", [BT_strings getJsonPropertyValue: self.screenData.jsonVars nameOfProperty:@"forceRefresh" defaultValue:@""]]]; this should print (to the debugger) the value of the force refresh json in the screen data. If it's set to '1', then there must be an apple issue. Otherwise check your config for the value, to see if it's coming from the control panel correctly, if at all. If not, check the control panel to see if it's in that little json window. If it's there, and not being carried to the app config, then there's a backend issue, but that should narrow it down enough to where they'll know where to look. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/14 03:49 AM (10 years ago)
Thanks Smug, will do
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
04/03/14 04:58 AM (10 years ago)
I had this same problem. Sometimes the screen would update and sometimes not. I usually have to change the HTML portion screen, update the information for that particular screen. I wound up switching to the HTML doc plugin and building the documents on my server. Dave
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
04/03/14 05:49 AM (10 years ago)
Hi Dave, I was tempted to do the same and load these html pages from a different source (and still might!). I'm using this plugin for 'info' pages against menus in my app i.e. for content that won't update very often, so it isn't critical, but editing some things 'on the fly' like this can be useful. I'm in the process of tweaking the text, which is how I noticed.
 

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.