Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 17    Views: 141

MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
07/09/12 05:11 PM (11 years ago)

App Refresh

Hey, so I'm Having a problem. For some reason my app, thats on app store, does see to be refreshing automaticly. I've made some changes since the app came out. If I download it now from the app store, when I first open it it does not refresh to the new version. I can only have it refresh if I go to the app in the control panel and open a screen and save something. Other wise, it doesn't seem to update? What could I have done wrong? Thank you
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/09/12 05:19 PM (11 years ago)
That's a problem noted earlier. Not sure what the problem is. Fred
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/09/12 05:20 PM (11 years ago)
@madrod just curious when you compiled the app did you have the latest config.txt inside of the app?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/09/12 05:27 PM (11 years ago)
Here's how it should work: * User open the app, and the app builds the screens using the latest version of the configuration file it has available. This could be (1) the version that shipped with the app, if no updates have been made, or (2) a cached version based on a previous opening of the app and an update occuring * App then checks the reportToCloud URL to see if there are any updates since the last time it updated. If there are, it downloads the latest configuration file and refreshes the app (after prompting the user). If there are no updates....meaning, it doesn't detect any changes from the last time it checked, then nothing happens. Mark
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/09/12 05:27 PM (11 years ago)
At the time yes. Now with a few changes, its diferent. @Fred, how would you go,around it? I'm guessing going to the CP everyday is not a solution? Cheers
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/09/12 05:45 PM (11 years ago)
Hi Mark, thanks for your reply, I,understand what you say, but what's happening is that if the update on the control panel is prior to the downlaod of the app from the app store, it doesn't update, ever. It only updates if an update in control panel is made after you bought the app. Thanks
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/09/12 05:57 PM (11 years ago)
Not sure where the problem is. You might try re-downloading the source code. If we could figure out the source of the problem we could try using source code from a app that doesn't have the problem. Chunk of code by chunk. This could be a lot of work. Best to narrow down the problem. You could search the forum for the previous thread it might have a clue. Don't remember the topic. Fred
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/09/12 06:02 PM (11 years ago)
Try forcing it to refresh (this requires an update to your current app) 1. Go to your yourappname_appDelegate.m 2. Look for: [modifiedAlert show] 3. Replace it with: [self downloadAppData] Upload the update to the AppStore.
 
TraceCampbellBSNRN
buzztouch Evangelist
Profile
Posts: 233
Reg: Dec 16, 2011
Forney
3,680
like
07/09/12 07:05 PM (11 years ago)
I have been having the same problem with one of my apps for new downloads off the store customers where getting a black screen until they refreshed and downloaded the new code. So the only way I could figure out how to fix it was to download the source code from BT again and resubmit it as an update hope this helps a little
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/11/12 09:03 AM (11 years ago)
When you resubmited, did it help? you think that the error might accour when you download from BT?
 
ridgerock
Veteran developer
Profile
Posts: 183
Reg: May 19, 2011
Louisville
1,830
like
07/12/12 08:53 AM (11 years ago)
Having the same problem. Maybe David can provide some insight.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/12/12 11:06 AM (11 years ago)
"If the update on the control panel is prior to the downlaod of the app from the app store, it doesn't update, ever. It only updates if an update in control panel is made after you bought the app. " This is by design. When the app launches for the "first time" it DOES NOT check for a new version of the config.txt file on the server. This is because there isn't any "last modified" to compare to in the device. This may seem problematic, and for sure there are lots of ways to engineer / change / alter the behavior. But, you're not dealing with something that is broken, just something that is working in a way that you didn't expect. a) user downloads app from app store. b) App loads and uses the config.txt file in the compiled binary (this data could be different than the data on the server if you've changed it). c) While user is using the app, or closes / reopens the app, it should prompt them to update because it then found some changes on the server. Like @Fred mentions, this topic has been on ongoing discussion for awhile and there are literally dozens of ways to set this up. The best way depends on the goal. We've setup it up to work this way and have since learned that every few weeks we here "it's not updating" when really it more of an "It's not behaving the way I expect." Makes perfect sense. OS: iOS and Android work slightly different in this regard (how they interact with the backend and when they "reportToCloud." This means you'll need to sleuth out the reportToCloud method in each platform to understand it a bit more (if you want to modify the default behavior). Lastly: The reasons we don't have it looking for updates RIGHT AWAY, as soon as the app launches for the first time, is because it's very very common for Apple quality control folks (the folks that approve / reject your app) intentionally disconnect your app from the network then launch it (for the first time). This causes the "error loading data" message because it's not online and has never been able to establish a "last modified" date. Another way to say it, it's our opinion that the app should launch for the first time without relying on the internet, even if it means there is newer data on the server.
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/12/12 11:40 AM (11 years ago)
Thank you so much for your reply. Being that the way apple reviews the apps, It makes sense to be the way it is. Thank you for pointing that out David.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/12/12 11:52 AM (11 years ago)
"When the app launches for the "first time" it DOES NOT check for a new version of the config.txt file on the server. This is because there isn't any "last modified" to compare to in the device." That is the key statement that I think not everybody understood completely...including myself. Thanks for the clarification, David! Mark
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/12/12 12:11 PM (11 years ago)
I Thought that statement was what happened, but I was wondering why it did that, why not check for an update anyways and force a communication. Also that we got a good justification. Thank you all once again.
 
funkydrummer
Android Fan
Profile
Posts: 11
Reg: Aug 03, 2012
Sammamish
3,310
like
08/11/12 07:13 PM (11 years ago)
I'm new to the BT community, but really liking this tool. Thanks for everything and to everyone on the forums for so much good info. I was concerned about this 'problem' as well. When I loaded the app on my android phone, it would briefly display the old screen I had played around with but deleted, then prompt to update the app (since I had new screens). I didn't want this to happen to everyone that installs the app. So, I recreated the BT code package and checked the recreated config file and it looks like it references the new screens properly. I haven't imported, compiled and created an apk to check if this 'fixes' things, but it looks like this should work. So, in short, if you significantly change the app, you may want to recreate the BT code, compile and repackage it to remove an immediate refresh on new install. Obviously save and copy any files you may have edited or added in the old code. This is probably cumbersome if you have lots of changes, but may work in my case since I plan for the app to be fairly static.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/11/12 07:27 PM (11 years ago)
Hi @funkydrummer, There's actually no need to download an entire new source package. You can grab the most current configuration data from the link in your control panel, and just paste it into your local BT_Config.txt file. That syncs the local copy with the server copy. Then do a Project...Clean, and rebuild. Viola! You have the most updated app possible. All without downloading new source! Mark
 
funkydrummer
Android Fan
Profile
Posts: 11
Reg: Aug 03, 2012
Sammamish
3,310
like
08/11/12 07:48 PM (11 years ago)
Awesome, I'll try 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.