Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5278] iOS: App properties don't immediately register a changed value

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-06T14:21:54.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-37, Release 1.8.0
ComponentsiOS
Labelsmodule_app_properties, qe-testadded
ReporterMatthew Congrove
AssigneeReggie Seagraves
Created2011-09-12T13:42:41.000+0000
Updated2014-06-19T12:46:26.000+0000

Description

When a user changes Ti.App.Properties outside of the application (e.g. the iOS 'Settings' application), the new value is not immediately available on application resume; instead, the previous value is given. After waiting a little while (anything below 2 seconds seems iffy), this value is updated appropriately. Reproduction follows... Steps to reproduce:

Open test application, then close

Open iOS Settings application, change value of "Foo" setting

Close Settings application and quickly re-open test application

After 2 seconds, values will be alerted. Item A will hold old value, while B, which was checked 2 seconds later, holds new value.

Ti.App.addEventListener('resumed', function() {
	var output = "A: " + Titanium.App.Properties.getString("foo") + "\n\n";
	
	setTimeout(function() {
		output += "B: " + Titanium.App.Properties.getString("foo") + "\n\n";
		
		alert(output);
	}, 2000);
});
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>StringsTable</key>
	<string>Root</string>
	<key>PreferenceSpecifiers</key>
	<array>
		<dict>
			<key>Type</key>
			<string>PSToggleSwitchSpecifier</string>
			<key>Title</key>
			<string>Foo</string>
			<key>Key</key>
			<string>foo</string>
			<key>DefaultValue</key>
			<true/>
		</dict>
	</array>
</dict>
</plist>

Comments

  1. Eric Merriman 2011-12-21

    Verified fixed in SDK: 1.8.0.1.v20111220190134. Set value now showing up on app resume with iPad 2 (5.0.1) and iPhone 4s (5.0.1).
  2. Eric Merriman 2012-01-06

    Reopening to edit labels

JSON Source