Discussion Forums  >  Self Hosted Control Panels

Replies: 10    Views: 508

SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
10/30/15 02:17 AM (9 years ago)

Live/Design Mode: How to Fix

Can I get someone to confirm that the 'live/design' mode feature is working? I've been playing with a new idea, and noticed that if I don't publish (because I've been using the 'live' mode config in my project) my changes don't get implemented. I think while David has been under the hood, he's found time to fix a couple of gotchas. Thanks David! Cheers! -- Smug
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
10/30/15 08:19 AM (9 years ago)
>he's found time to fix a couple of gotchas. And if he has, I wish he has told us about that.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
10/30/15 08:37 AM (9 years ago)
Did a quick test, and it looks like it's still broke. :-( * Opened my app and requested a refresh * Changed the Bar Title on one of my screens * Hit Save, but NOT Publish * Requested and app refresh, the change was there Bummer! Mark
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
10/31/15 04:33 PM (9 years ago)
that's odd. If you look into the control panel 'live' json vs the 'debug' json, it works; you have to press 'publish' for changes to be in the live config. But you're right; the 'app' changes are immediate. Which leads me to believe that the config being fed the app is not actually the live config... Damn. I was hoping this was fixed. Cheers! -- Smug
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/01/15 01:05 AM (9 years ago)
I agree...it seems to be working in the control panel. And, I've verified that I've published my apps with Live vs. Design mode. Yeah, I was hoping it was fixed as well! Mark
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
11/02/15 03:31 AM (9 years ago)
Hey, Mark/Dusko... Try this and tell me if it works for you... In your app 'core' properties, append the 'configuration data url' with: &currentMode=live So your complete string would be something like: http://www.someserver.com/api/app/?command=getAppData&appGuid=XXXXXXXXX&apiKey= XXXXXXXXX&apiSecret= XXXXXXXXX&currentMode=live and see if that helps you any... Still playing with everything but a device, but so far it's encouraging... It seems that variable is being dropped off the app. Looking into it further as I go... Cheers! -- Smug Edit: I guess you'd really want to ensure that was in the 'default' config in the app as well, so that on first launch, it would also behave similarly... Last Edit: Just change the configuration url in the core properties, and use a 'live' config in your app ensuring the updated configuration data url. That's all it will take.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/02/15 07:27 AM (9 years ago)
Sweet! Thanks for working out a fix, Smug. Been holding off updating some apps because of this issue. You rock! Mark
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
03/04/16 12:34 PM (8 years ago)
Is this equivalent to the other hack shown at the following post? https://www.buzztouch.com/forum/thread.php?tid=6B929DD9BEA427FE2EB276E&fid=06DB0BCB08E2222&sortColumn=FT.id&sortUpDown=&currentPage=1 i.e. does this workaround accomplish the same thing, and in ether workaround a new update must be published to the app store?
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
03/08/16 02:43 AM (8 years ago)
@Smug Based on my testing, it does not appear that the variable is being dropped off by the app. Rather, it seems that somehow the value of the currentMode variable is being changed from "Live" to "Design" and it is then being appended to the URL but with the wrong value. Below are the lines of debug code I added to _appDelegate.m to have the variable's contents echoed out to the debug display, and below that are the resulting debug messages. Notice that the variable somehow contains "Design" despite the fact that I edited BT_config to say "Live" -- and I have checked and confirmed (conclusively -- by opening up the app itself and checking) that the correct BT_config contents are being compiled in the app. ============= Debug lines added: ============= //reportToCloud... -(void)reportToCloud{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"LINE 299: reporting design/live mode as (currentMode=): %@", currentMode]]; //didRegisterForRemoteNotificationsWithDeviceToken... -(void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"LINE 825: reporting design/live mode as (currentMode=): %@", currentMode]]; //unRegisterForPushNotifications... -(void)unRegisterForPushNotifications{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"LINE 876: reporting design/live mode as (currentMode=): %@", currentMode]]; ========================== Resulting debug messages displayed: ========================== 2016-03-08 04:31:00.613 cacmobile[698:250801] cacmobile_appDelegate: LINE 825: reporting design/live mode as (currentMode=): Design 2016-03-08 04:31:00.613 cacmobile[698:250801] cacmobile_appDelegate: didRegisterForRemoteNotificationsWithDeviceToken: Device Token: <40bc4898 36b9384b 1a7b10f9 8cc24786 c726eeac 9a30cc69 c7706b52 066b8a95> 2016-03-08 04:31:00.616 cacmobile[698:250801] BT_strings: mergeBTVariablesInString (before): http://churchapp.me/appcontrolpanel/api/app/?command=registerForPush&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=[deviceId]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&deviceModel=[deviceModel]&userId=[userId]&deviceType=ios&deviceToken=40bc489836b9384b1a7b10f98cc24786c726eeac9a30cc69c7706b52066b8a95&currentMode=Design 2016-03-08 04:31:00.620 cacmobile[698:250801] BT_strings: mergeBTVariablesInString (after merge): http://churchapp.me/appcontrolpanel/api/app/?command=registerForPush&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=FF4113E4-D8F1-45FB-BFF1-D95550B3E8E1&deviceLatitude=0&deviceLongitude=0&deviceModel=iPhone&userId=&deviceType=ios&deviceToken=40bc489836b9384b1a7b10f98cc24786c726eeac9a30cc69c7706b52066b8a95&currentMode=Design 2016-03-08 04:31:00.620 cacmobile[698:250801] BT_device: registerForPushNotifications: http://churchapp.me/appcontrolpanel/api/app/?command=registerForPush&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=FF4113E4-D8F1-45FB-BFF1-D95550B3E8E1&deviceLatitude=0&deviceLongitude=0&deviceModel=iPhone&userId=&deviceType=ios&deviceToken=40bc489836b9384b1a7b10f98cc24786c726eeac9a30cc69c7706b52066b8a95&currentMode=Design [... later ...] 2016-03-08 04:31:15.839 cacmobile[698:250801] cacmobile_appDelegate: LINE 299: reporting design/live mode as (currentMode=): Design 2016-03-08 04:31:15.839 cacmobile[698:250801] cacmobile_appDelegate: reportToCloud 2016-03-08 04:31:15.840 cacmobile[698:250801] BT_fileManager: File does not exist in cached directory: "appModified.txt" 2016-03-08 04:31:15.840 cacmobile[698:250801] BT_fileManager: saveTextFileToCacheWithEncoding: "appModified.txt" encodingFlag: -1 2016-03-08 04:31:15.845 cacmobile[698:250801] cacmobile_appDelegate: reporting to cloud at : http://churchapp.me/appcontrolpanel/api/app/?command=reportToCloud&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=[deviceId]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&deviceModel=[deviceModel]&userId=[userId]&currentMode=Design 2016-03-08 04:31:15.846 cacmobile[698:250801] BT_strings: mergeBTVariablesInString (before): http://churchapp.me/appcontrolpanel/api/app/?command=reportToCloud&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=[deviceId]&deviceLatitude=[deviceLatitude]&deviceLongitude=[deviceLongitude]&deviceModel=[deviceModel]&userId=[userId]&currentMode=Design 2016-03-08 04:31:15.855 cacmobile[698:250801] BT_strings: mergeBTVariablesInString (after merge): http://churchapp.me/appcontrolpanel/api/app/?command=reportToCloud&appGuid=EA1951A64F5DD225E6644D0A5&apiKey=A7FAED8187992B9294DDF0B&apiSecret=0F1705558A5E68CD5043C03&deviceId=FF4113E4-D8F1-45FB-BFF1-D95550B3E8E1&deviceLatitude=0&deviceLongitude=0&deviceModel=iPhone&userId=&currentMode=Design
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
03/08/16 02:58 AM (8 years ago)
I have applied the "hardcode" hack described here: https://www.buzztouch.com/forum/thread.php?tid=6B929DD9BEA427FE2EB276E&fid=06DB0BCB08E2222&sortColumn=FT.id&sortUpDown=&currentPage=1 Which is to say, in three (3) places in _appDelegate.m, I replaced the following with the line under it: // useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&currentMode=%@", [self currentMode]]]; useURL = [useURL stringByAppendingString:[NSString stringWithFormat:@"&currentMode=%@", @"Live"]]; I have verified that after doing so, while the value in the "currentMode" variable is still wrong (still "Design"), the hardcoding trick gets around it, and the device registers in "Live" mode.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
07/27/17 08:06 AM (7 years ago)
I know this is an old thread, but I just started looking into this problem in BTv4. Seems to still be broken. And from what I can tell (with my primitive code interpretation skills...) is this: the currentMode only seems to be appended to the useURL inside the "didRegisterForRemoteNotificationsWithDeviceToken" part of the appDelegate There's nowhere else that it happens. Used to happen elsewhere in older versions. So during my tests, this never happens, and therefore "Live" can never be appended to the URL. I might be wrong on this, but I think this is not how its supposed to 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.