Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 10    Views: 265

peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
05/22/14 07:07 AM (9 years ago)

iOS, BT 3.0: Refresh prompt does not appear

I hate to create another post for an issue that has a lot of other posts on it already, but mine is a little more concerting because my app won't refresh unless the refresh button is pressed. I've read a lot of the posts about the live/design mode issue, and about making the refresh automatic. I had it set up in Xcode to automatically refresh, but then I noticed that didn't work when I made a change in the BT control panel. So, then I reverted to the "[modifiedAlert show]", and expected that when I made a change, I'd get the "Would you like to refresh?" prompt. I don't get a prompt. I've tested in in both design and live modes, publishing and not publishing, and it's like the code to show the prompt is skipped. If I tap the refresh button on the app, then it will refresh and I'll get the change. I'm going to keep looking over the code, and the debug console, but I'm curious if anyone else has had this issue, or if you have thoughts on how to debug?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/22/14 07:24 AM (9 years ago)
Sometimes it is as slow as hell to update, also I find if you always save the navbar section again it works faster. One of those things
 
Intrege
Veteran developer
Profile
Posts: 196
Reg: Sep 12, 2011
Philadelphia, P...
3,160
like
05/22/14 07:41 AM (9 years ago)
True @Kitsy. I also keep a refresh button in the navbar for the users to press as well. Work s for me.
 
peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
like
05/22/14 07:51 AM (9 years ago)
Very good info, Kittsy, thanks! I can see the refresh prompt now, but something is still not right. In order for me to see the refresh prompt, I have to: 1. Save on BT control panel. 2. Launch app (or bring to foreground). 3. Save on BT control panel (again). 4. Launch app. So far every time I've hit save just once, it won't refresh. If I hit it a second time, I get the refresh prompt immediately.
 
peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
like
05/22/14 11:00 AM (9 years ago)
Okay I have more information, although my brain is starting to contort. It's like a "background-foreground" cycle is required in order for a refresh prompt to be triggered. If you want to see this for yourself: 1. Open the app. 2. Send the app to the background, and bring it to the foreground. 3. Make a change to the config file. 4. Send the app to the background, and bring it to the foreground. Observe the refresh. 5. Make another change to the config file. 6. Send the app to the background, and bring it to the foreground. Observe no refresh. Now that I understand it better, it feels more like a corner case, because the odds that a customer only ran an app once in between config file changes is probably low. I would think typical customers have opened and closed the app a few times. This could be a greater issue where maybe you make changes to the config file multiple times per day, but even then as long as your users are opening and closing regularly, and you're making your many changes, the customer won't have to wait for too long before they'd get the refresh.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/22/14 11:02 AM (9 years ago)
I looked into a while ago things changed with the 3.0 all the stuff got moved from the appdeleage to the loadviewcontroller I think the background refresh when app opened is a little but fluffed , it works sometimes other times it doesn't one of life's little mysteries
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/22/14 11:03 AM (9 years ago)
A lot say use an auto refresh now I've found this also to be a bit buggy and will refresh to much lol
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/22/14 06:18 PM (9 years ago)
Take a look at chris1’s fix to see if it applies to your situation: https://www.buzztouch.com/forum/thread.php?tid=D46AEFA297E85F94982FCB9
 
peterj
Apple Fan
Profile
Posts: 113
Reg: Jun 19, 2011
location unknow...
6,630
like
05/23/14 06:40 AM (9 years ago)
Thanks for your response, Niraj - I had seen that posting when investigating the live/design issue. It does not resolve this issue. @Kittsy: I like auto-refresh and use it in my other apps..I'll use it in the new one I'm making, too. However, we'll still have this issue with auto-refresh, it's just much harder to notice. I get the spinner screen every time I launch the app, whether it refreshes or not. The spinner made me think it was refreshing, but I don't think it always is. It wasn't until testing the conditions in the thread Niraj mentioned that I noticed something odd was going on and noticed the need to "background-foreground" my app at least once before saving a change. @Intrege: I have a refresh button in my app too, but with no prompt, how will users know that content has changed? The issue is that the prompt doesn't appear, and that the app thinks it has the latest config, when it doesn't. I'm not sure I'd expect my users to try refreshing if they don't see something they expect to, especially if I've done the auto-refresh to make it easier on them. I still have to think this is a corner-case, though, and combined with the fact that it's hard to catch, I think most developers and users think everything is working normally, even though this issue is present. I'm still going to launch my app even with this issue, because I don't think many users will get stuck here. All you have to do is open and close the app twice, and this issue won't occur.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
05/24/14 10:18 AM (9 years ago)
This is my understanding of things from a 2013 explanation by chris1 or another notable expert:: Your app has the config file that you had Compiled into it. The app is on the App Store. In the meanwhile, you have made changes in the Control Panel and clicked on Publish to copy it from the Design Configuration over to the Live Configuration. A user then downloads the app from the Store. A 1st run of the app causes the app to copy the BT_config.txt file into a Cache file. The 1st run of the app uses the newly Cached config -- which is same as you had Compiled into it. The app only shows the content and configuration of the original compiled version. A 2nd run of the app does a Timestamp compare of the Cached config file against the Cloud config. During the 2nd run of the app, the Timestamp comparison causes the the Cloud config file to be downloaded. The Cloud configuration then replaces the 1st run Cached file. Then the 2nd run of the app reflects all of the changes that were made prior to the last click of the Publish button on the Control Panel. Every Published change will get absorbed by each successive run of the app. -- Niraj
 
Nelson
Aspiring developer
Profile
Posts: 57
Reg: Jun 06, 2013
Viseu
2,220
like
09/10/14 05:10 AM (9 years ago)
hello peter i have the same problem. Now I do this way. try it. Puts BT_Config.txt "CurrentMode" to "Live". Go to ... appDelegate.m exchange for [self refreshAppData]. download the code again and put it on the iPhone. when you want to refresh the app goes to Publish Changes and follow these steps. 1 Go to Publish Changes. Puts corsor inside the "Enter the Version (numeric)" dialog box you have to click inside the box. Hit refresh once. 2 Do it again. Puts corsor inside the "Enter the Version (numeric)" dialog box you have to click inside the box. Hit refresh once. 3 Wait 1m20s and Do it again. Puts corsor inside the "Enter the Version (numeric)" dialog box you have to click inside the box. Hit refresh once. The app whenever you open starts with a refreshing updated. I do not know why but it results in my app. The app is not online and I am self hosted. I hope this helped you.
 

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.