Discussion Forums  >  Suggestions, Ideas, Wish List

Replies: 5    Views: 112

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

Forcing a refresh

I'm thinking of moving the config.txt for an app I am working on to my server, as I am trying to see if I can update the json lastModified timestamp in the config.txt in an automated way. My objective is to trigger a refresh in my app, without using anything on the control panel. I've tried this by manually editing the config and FTP'ing it to my server, which works as my app is picking up my edited config.txt from the new location. Problem is I'm not convinced that just modifying lastModified is enough, because my ios app doesn't prompt me to say my data has changed. Am I missing something?
 
HerrNathan
Aspiring developer
Profile
Posts: 73
Reg: Oct 11, 2011
Stirling
5,830
like
06/23/14 11:36 AM (10 years ago)
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/23/14 12:11 PM (10 years ago)
Thanks @HerrNathan, I have seen that solution too and I think it is a good thing. As I understand it, it removes the prompt to say the data has changed and the app just does the refresh request automatically. However, I believe this action still relies on the app getting that trigger.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/23/14 02:40 PM (10 years ago)
I doubt if I'll have much to add to what you've already tried, however I still feel like I should point to these resources. They don't explain how to do that, but they do expand on what some of the uses for the key/value pairs in the JSON, which may (or may not) lead you to success. https://www.buzztouch.com/files/howtos/Understanding_App_Refresh_and_Offline_Apps_v1.0.pdf http://www.buzztouch.com/docs/v1.5/reportToCloud.php http://www.buzztouch.com/docs/v1.5/configData.php Don't know if it will help, but thought it might be worth mentioning. Cheers! -- Smug
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/24/14 06:46 AM (10 years ago)
Thanks for this Smug, I read and re-read them, it is surprising how much more clearly I understood them the second time around. In particular http://www.buzztouch.com/docs/v1.5/reportToCloud.php (good doc by Mark Fleming) seems to provide the key information, but I still can't figure this out. There are two specific area's I have been concentrating on, the config.txt and the report to cloud url. Looking at the conf file seems to be a dead end; moving the config.txt onto my server and changing the last modified timestamp in there does not trigger a refresh; I think the value in config.txt is used by the app to compare to the value in the report to cloud URL. So I started to concentrate on the report to cloud url. If you drop the standard one into a browser, you can see it contains one line of json text, which is a timestamp e.g {"lastModifiedUTC":"Sat, 04 Jun 2011 06:40:32 -0700"} I created a text file (e.g. myrpc.txt) with the same json line on my server and pointed my report to cloud url to that. I thought that if I was to update my text file, I would trigger a refresh. Sadly no, my app doesn't seem pick up on that. So it seems I am back where I started, but I feel I am getting closer!
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/24/14 07:48 AM (10 years ago)
I've had a look at my control panel and the report to cloud URL hits a php script, so I am beginning to suspect substituting a simple text file is not going to work. I am beginning to think that instead of replacing the report to cloud URL, having a second timestamp file somewhere and getting the app code to look for that as well as the report to cloud url might work. If either timestamp file has a value that is greater than the one in config.txt, the app would then do a refresh. The reason I am looking for this solution, is I have content referenced by the custom URL plugin that doesn't update as it is off the control panel. Or get Force Refresh in Custom URL to not cache. Or find a way of 'poking' the control panel from outside, to trigger a way of updating the report to cloud timestamp and trigger refresh? If only I had the slightest clue how to make any of those ideas work!
 

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.