Discussion Forums  >  Uncategorized

Replies: 13    Views: 574

birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
04/15/11 06:55 PM (13 years ago)

Auto Refresh v1.5?

Hello, I have been away for a few weeks, finally able to devote some more time to finishing my first 1.5 app. I have been keeping track in the forums and lots of exciting stuff going on!! My question is regarding the refresh procedure for 1.5. My only fear is that a user could keep pressing the no button, when prompted to update/refresh their apps content. I was wondering if it is possible to do a forced - auto refresh? I know there are a lot of variables involved and this may or may not be advisable to try. Maybe I'm just over paranoid too... Thanks in advance for any insight. Best Regards, Brian-
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/16/11 08:51 AM (13 years ago)
It's OK to think this way and condering these issues is an important part of the process. It's not complicated to do what you're asking, but, I don't think it would accomplish much. Many thousands of buzztouch apps have been created and almost NOBODY clicks 'no' when asked to refresh. Your audience may be different... but I doubt it. If you want to force-refresh and bypass the alert.... do this.. have a look at [app-hame]_appDelegate.m in the BT_Config folder. When the reportToCloud method completes, it checks to see if any content has changed. If it has, an alert is displayed with a confirmation button. This happens on about line 529. If YES is clicked, the downloadAppData method is triggered, this is the actual refresh method. So.... replacing [modifiedAlert show] with [self downloadAppData] would prevent the confirmation box from showing and force a refresh if the content has changed.
 
birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
like
04/16/11 03:46 PM (13 years ago)
Hello David, Thanks very much for the tip! I followed your instructions and now the app data downloads automatically, without prompting the user. I do agree with your comment. There are some pros/cons in doing an auto refresh. One potential gain of the update alert dialog is the fact that the user is notified of new content. Which in turn, may make them load the app more often expecting to see updates. I'll have to weigh these options before I go live with it. Thanks again for your help! Best Regards, Brian-
 
samme71
Apple Fan
Profile
Posts: 29
Reg: Apr 10, 2011
South Carolina,...
3,840
like
04/16/11 06:02 PM (13 years ago)
Just wondering if this method of a forced refresh would also work to reload RSS and URL screen data. I tried during the build of my app to remove the dataUTL and cloudURL, which removed the refresh button but it also caused the RSS list data to not reload when data changed. Is there a way to force the RSS screens and URL screens to reload even without the refresh button or doing a background refresh. I guess Im asking if the refresh is tied to all data changes or just the buzztouch data.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/16/11 10:31 PM (13 years ago)
@ samme71: Most screen-types have a loadData and a downloadData method. It's the job of 'loadData' to determine where to get the data. If it's local, use that, if it's not, use the dataURL by calling downloadData This means you could easily modify loadData to just always trigger downloadData so it always checks online for the latest content. To clarify: You would make these adjustments in each screen. Like BT_screen_rssReader.m and BT_screen_customURL.m and others... not in the [app-name]_appDelegate.m file. This delegate file manage the apps configuration data, not individual screen content.
 
samme71
Apple Fan
Profile
Posts: 29
Reg: Apr 10, 2011
South Carolina,...
3,840
like
04/17/11 09:35 AM (13 years ago)
Thanks for the tip. I did find the loadData and the downloadData sections of xcode but i'm not really sure what change to make. could you please be more specific about the modification to make to loadData to force an online download when the screen loads. Thanks
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/17/11 10:46 PM (13 years ago)
Sure, lets say you wanted to force-refresh the RSS screens. In BT_screens_rssReader.m, find this in the loadData method //look for previously used version... if([BT_fileManager doesLocalFileExist:[self saveAsFileName]]){ [BT_debugger showIt:self:@using cached version of screen data]; NSString *staleData = [BT_fileManager readTextFileFromCacheWithEncoding:self.saveAsFileName:-1]; [self parseScreenData:staleData]; }else{ [self downloadData]; } (NOTE: The forum removes double quotes, you'll see them in the source code) What's happening here is the program is looking for a cached version of the feed from the last time it downoaded it. If it finds it, it's loading up the staleData string variable with the contents then calling parseData. If it doesn't find any chaced (stale) data, it calls downloadData. This just means you can remove all that and call downloadData everytime. Literally remove that section of code and replace it with [self downloadData] You could also comment it out if you don't want to remove it, like this... //look for previously used version... //if([BT_fileManager doesLocalFileExist:[self saveAsFileName]]){ // [BT_debugger showIt:self:@using cached version of screen data]; // NSString *staleData = [BT_fileManager readTextFileFromCacheWithEncoding:self.saveAsFileName:-1]; // [self parseScreenData:staleData]; //}else{ // [self downloadData]; //} [self downloadData] See how were forcing [self downloadData] everytime. This is all inside the loadData method.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/17/11 10:53 PM (13 years ago)
cool!!
 
samme71
Apple Fan
Profile
Posts: 29
Reg: Apr 10, 2011
South Carolina,...
3,840
like
04/18/11 05:12 AM (13 years ago)
You Rock! Thanks for that.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
06/25/11 01:54 AM (12 years ago)
So can this work for auto refreshing menu lists too, even if the app has not been closed? the code looks different in the menu_list.m file would like my menu lists to auto refresh as well even if user has not closed and opened app...possible? thanks
 
Don Javi
Aspiring developer
Profile
Posts: 91
Reg: Oct 08, 2011
Burriana
910
like
12/08/11 06:43 AM (12 years ago)
Excuse me, took a while thinking how to do this, but I have not been able to. I followed the unstrucciones of David, to force the display of RSS, but not exactly what I have to do. Can you help please?
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
02/29/12 03:18 PM (12 years ago)
I cant find in the BT config folder?? any ideas or any ways to search for it so i can force an update? Thanks
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
08/18/12 10:46 AM (11 years ago)
Anyone know where to find the [app-hame]_appDelegate.m in the BT_Config equivalent for Android? I've searched for [modifiedAlert show] in various files and couldn't find it. Fred
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
12/27/12 03:23 AM (11 years ago)
I need to get the screens refreshed without them being opened at all. Say for example I have new versions of HTML docs which are linked to a menu item. I want to auto-refresh in the term that all the screens in my app are refreshed and newly downloaded from the urls they have, without having to click them. This way the user won't face the "Data for this screen has not been downloaded....." message, since it was downloaded just at the moment he selected to refresh the app (hence he was online). So whether or not I give him refresh confirmation is not the exact issue. The issue is that the screens are automatically downloaded when a refresh is made, without the need to go into the screens themselves. Thanks guys, and sorry for not creating a new thread. It looked like this one was very close to my situation.
 

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.