Discussion Forums  >  Uncategorized

Replies: 8    Views: 379

birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
09/30/11 04:30 PM (14 years ago)

Auto Refresh earlier during app load? 1.5 iOS

Hello, I have set my v1.5 app to auto refresh, instead of alerting the user to updates. Auto Refresh is easy on iOS thanks to a tip from David a while back: http://www.buzztouch.com/forum/thread.php?tid=35C9CCA460F85572608CF3B You simply make a small adjustment to your YOURAPPNAME_appDelegate.m file around line 554 or so: change [modifiedAlert show]; to [self downloadAppData]; No more alert boxes for app updates will show and the app will refresh automatically, this works great. I am trying to figure out a way to change the order of the check for update process. Ideally I would like to have the check for update process happen earlier, when the loading/splash screen is still on. Example would be if the user opened the app and saw the usual splash screen (Default.png), then the auto update process would happen in the background with the splash screen still visible along with the usual spinner indicating the update was downloading/being checked. Then the app would load to the home screen when this was complete. The way it works now is that the entire app loads and enters the home screen before checking for updates. If an update is in order, a few seconds later the user is presented with a spinner animation indicating the refresh. Sometimes this update process is delayed and the user is presented with old information for the first few seconds, before the app auto refreshes. Anyways, no big deal if it is not possible. Just wondering if it is as easy as changing the order of the update code in the appDelegate file, or if this would require some code kung fu. Thanks in advance for any insight. Best Regards, Brian-
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
09/30/11 06:31 PM (14 years ago)
Sorry I can't help but wanted to say cheers for the auto update link, good stuff, missed that one.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/02/11 08:27 AM (14 years ago)
The order in which things happen is important. But, of course you can hack-around a bit. The trick is identifying WHEN this happens. It's one thing to check for updates when the app first launches, checking for updates with it's brought to the forefront is totally different. Most users don't actually kill apps anymore on iOS so the 'app first launches' process runs very rarely. You'll need to figure out the best place to do this. Either way, the reportToCloud method is what handles this. So..reportToCloud is the method you want to trigger to check for updates. This method in in your app's delegate.m file. The trouble you may have is the splash screen idea. Your Splash Sceen wont' exist until after the app's interface has been created. It can't create the splash screen until it undrstands what screen (screen nickname, id) you have setup. Have a look at the configureEnvironmentUsingAppData method in the app's delegate. The reportToCloud method is fired AFTER the layout has been created. This happens on line 335. Tinker with where the method is called and see if you can get it happen earlier without breaking anything ;-)
 
birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
like
10/02/11 09:00 AM (14 years ago)
Hello David, Thanks for the tip! That gives me a good point to start from. I'll experiment with the reportToCloud method and see how it goes. Good point on the iOS launch process and the fact that the app may continue to run in the background. Your source code is very well documented, so it has been a huge help when learning the nuts and bolts of the app. :) I'm working on an app for the historical society in Vacaville. Lots of historic photos from places you will probably remember. I'll let you know when it is in the app store! @MacApple - No problem at all! It's a neat little hack to have handy! Best Regards, Brian-
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
10/02/11 08:15 PM (14 years ago)
Ironic, I spent the weekend volunteering at our local Historical Societies Annual Home Tour. I was a docent (that means I have to study and know more than the visitors!) at one of the houses - good times. I'm sure Vacaville's gang will be stoked to see whatever you come up with ;-)
 
birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
like
01/09/12 09:44 PM (14 years ago)
I've been away from BT for a while working on websites, now I am back for some more app fun! I messed around with PhoneGap for a while, but Buzztouch is WAY BETTER & Faster!!! I am loving the plug-in concept of BT-server too! As noted in my first post on this thread, I have auto refresh implemented in iOS BT-Server. The home screen on my app changes often, so the issue I encountered was that the user would see the old content for a brief period before receiving the new update. The Fix = SPLASH IMAGE! By having a splash screen image set for about 3 to 4 seconds, the user won't see the old content and the refresh will happen while the splash screen is still up. This is helpful if your app's home screen changes often. You can model your splash screen image like your Default.png file. Maybe adding some text in your splash image like - Checking for updates or something. Anyways, I hope this helps folks out. Very simple solution that was there all along! It is amazing what you can do with Buzztouch! Best Regards, Brian-
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
01/10/12 05:07 AM (14 years ago)
Good to have you back, don't be a stranger.
 
birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
like
01/10/12 12:05 PM (14 years ago)
@MacApple Thanks for the welcome back! Lots of fun stuff happening on the forums! I'll be sticking around asking questions and helping out wherever I can too :) Best Regards, Brian-
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
01/10/12 01:24 PM (14 years ago)
Good man, have seen a few solid helpful posts from you and I've picked up tricks from your good self. Friday yet?
 

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.