Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-5278

iOS: App properties don't immediately register a changed value

    Details

      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:

      1. Open test application, then close
      2. Open iOS Settings application, change value of "Foo" setting
      3. Close Settings application and quickly re-open test application
      4. After 2 seconds, values will be alerted. Item A will hold old value, while B, which was checked 2 seconds later, holds new value.

      app.js

      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);
      });
      

      Root.plist

      <?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>
      

        Attachments

          Activity

            People

            • Assignee:
              rseagraves Reggie Seagraves
              Reporter:
              matthewcongrove Matthew Congrove
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-4467
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration