Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 59

sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
01/17/16 04:11 PM (8 years ago)

Custom HTML / Text plugin and forceRefresh

What are the rules around the forceRefresh if it's set to allow caching? Does it ever update?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/17/16 09:39 PM (8 years ago)
It should always update if a network connection is available. If you notice in your BT_config.txt file, the URL for the page connects to Buzztouch. So, each time that screen loads in the app, it'll make an attempt to connect with BT to get the latest. If a network connection isn't available, it will try and show a cached version...but, in my experience, that part hasn't always worked. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/17/16 09:48 PM (8 years ago)
Hmm, so is HTML doc more reliable for caching? https://www.buzztouch.com/plugins/plugin.php?pid=B2C3F8DF263F5F2C4D6D8C8 I've got users testing using Custom HTML but can reissue to them.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/17/16 09:53 PM (8 years ago)
Is this a dynamic document, with content that changes a lot, or one that is relatively static? If it's static, then using HTML Doc and including it in the app is the best way to go. If it's dynamic, then I'd probably still use HTML doc...I've had a bit more success with it and caching. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/18/16 06:54 PM (8 years ago)
It'll be dynamic, needs to be able to be updated in a CMS to reflect current deals available to members. My 2 main people are demoing on Saturday to the rest of the Exec so I'll leave it alone and then update next week. It's ok for now. thanks!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/18/16 11:15 PM (8 years ago)
Your best bet then would be a remotely hosted HTML Doc that people can update. If you use the Custom HTML/Text screen, you would have to give people access to your control panel. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/19/16 02:39 AM (8 years ago)
I've got it working at the moment with custom html on docs generated by the client's cms using a bit of magic so I just need to change the plugin name and reissue them with test apps with the right plugins embedded. One of my testers came up with a weird one today though, her android phone didn't give her an option to refresh - came up automatically but she couldn't trigger it manually. Thank goodness I'd already taught her how to do screenshots and she was able to email me her screens.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/19/16 09:47 AM (8 years ago)
There is an option in the plugin to provide the Refresh button. I don't believe it's enabled by default. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/19/16 01:56 PM (8 years ago)
This was at the homepage level, to refresh bt_config.txt
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
01/21/16 06:21 PM (8 years ago)
Hi Mark I've rustled up a version of the app and when I go to open the page it puts a step in place to download the page (because they're all going to be URL based). I can see how I can bypass that in the java file and there doesn't appear to be a setting to get around it. Before I go hacking around in David's code can you confirm that I'm taking the right approach.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/21/16 10:46 PM (8 years ago)
Hello, I'm not quite sure what you're asking. When you use the plugin, and provide a URL for the data, it should go out and download the page each time you open that screen...that's the default behavior. If you watch the debug output when you use this screen, you can see it happen. In the plugin, there's a section for "Document Behavior." Under that, there is a drop-down for Force Refresh, and you can choose to allow caching, or to force a refresh. Allowing caching is good if you want data to be available when there isn't a network connection. But, even in that case, it should, each time you open the screen, try to download the content. If it's unable to, and you've allowed caching, it'll use the cached version. In fact, I believe it caches the document each time anyway...you're just telling it whether to use it or not. Does this help? If not, let me know, and we'll work it out. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
03/06/16 09:28 PM (8 years ago)
Hi Mark I've finally wound my way back to this one Check out https://cloudup.com/iCowE0_IrCl When the page is opened there is no copy in the app so the user is prompted to download and when they view it opens a new screen. The interface isn't great because "Open Doc" doesn't seem to work, the user has to click on the icon. I'd like to bypass that and just get the document.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/06/16 10:39 PM (8 years ago)
Hi Sarah, This is pretty much the way Android works. If it's not able to display content for some reason directly in the app, it'll prompt the user for a "helper app" that it can send the content to. Android is kinda dumb that way. Some ways around it: (1) use a Custom URL and point to the document...that "may" work (there have been some issues recently), (2) use the Custom HTML/Text plugin, which keeps the content on the BT server and serves it up in a webView, or (3) I believe there's an Android plugin on the market that basically rewrites the browser. Mark
 
sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
like
03/06/16 10:47 PM (8 years ago)
I've gone back to your #2 :)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/06/16 10:50 PM (8 years ago)
Cool...that should work! If the content is static (won't change a lot), you can always include the file with the app and then it won't have to download it.
 

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.