Discussion Forums  >  Uncategorized

Replies: 3    Views: 282

cteselle
Apple Fan
Profile
Posts: 34
Reg: Jun 13, 2011
California
340
06/20/11 10:49 AM (14 years ago)

Configuration and Menu dataURL questions

First, I'm using my own Configuration Data URL in the core properties. When I make a change to my settings on my webserver, I'm not getting the notification that the settings have changed in the app. Is this a webserver configuration issue? I have my config file in a password protected directory and am using a url like http://user:[email protected]/locationtomyfile.txt if that matters. Second, is there a problem with setting the dataURL value to from the config file for various menu screens? The main config file seems to have all this data already included, so is the point of that entry to be able to refresh the data on a per screen basis? Using 1.5 for iOS. Thanks in advance!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/20/11 01:38 PM (14 years ago)
Ok...so, no point in using dataURL values on individual screens (in your case), remove those. The script at the reportToCloudURL is what tells the app if it needs refreshed or not. Here's how it works. a) App launches (or is brought to forefront) and fetches a value from the reportToCloudURL. This is a simple date stamp returned by your server. b) App saves this value for reference c) If it's different that the last time it checked it downloaded the entire config file from dataURL Have a look at the reportToCloud method and the connectionDidFinishLoading method in your appdelegate.m file and you'll see where this works.
 
cteselle
Apple Fan
Profile
Posts: 34
Reg: Jun 13, 2011
California
340
like
06/20/11 02:30 PM (14 years ago)
Thanks so much, I didn't even think to check the reportToCloudURL since I had GPS turned off. When the initial check happens (after AppStore download) what date is that compared to? Creation date of the BT_config.txt file?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/20/11 09:44 PM (14 years ago)
Nope...when it checks for the first time, it doesn't force a refresh because the 'last saved date' is not available and it uses the configuration data in the BT_config.txt file, downloads the last modified date from the server and saves it. The next time it loads it will then re-download the last modifiied date and do the comparison. The app saves a file with the last modified date it it's cache. The file is called appModified.txt. You can see this file in the simulator. My comptuter saves simulator data files here: /Users/davidbook/Library/Application Support/iPhone Simulator/4.2/Applications/[the app id]/Documents Yours probably does the same thing. Have a look at the contents of appModified.txt after the app downloads it, this is the value returned by the server at reportToCloudURL. Your reportToCloudURL can also include devices variables (merge fields) if you want to save information about the device's location, model, and other things each time it 'reports to cloud'
 

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.