Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24051] Windows: Add the ability to remove all Ti.App.Properties at once

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-11-11T07:31:17.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.1.0
ComponentsWindows
Labelsqe-6.0.0
ReporterEwan Harris
AssigneeKota Iguchi
Created2016-10-19T08:53:26.000+0000
Updated2016-12-22T23:06:44.000+0000

Description

Description

TIMOB-23572 implemented Ti.App.Properties.removeAllProperties() for iOS/Android, it should also be implemented for Windows too. Demo code below
// Check the initial properties (should only be the iOS ones)
Ti.API.warn(Ti.App.Properties.listProperties());
 
// Add all possible property-types (bool, int, double, string, object & list)
Ti.App.Properties.setBool("testBool", true)
Ti.API.warn(Ti.App.Properties.getBool("testBool"));
 
Ti.App.Properties.setInt("testInt", 1337)
Ti.API.warn(Ti.App.Properties.getInt("testInt", 1337));
 
Ti.App.Properties.setDouble("testDouble", 13.37);
Ti.API.warn(Ti.App.Properties.getDouble("testDouble", 13.37));
 
Ti.App.Properties.setString("testString", "john_doe")
Ti.API.warn(Ti.App.Properties.getString("testString", "john_doe"));
 
Ti.App.Properties.setObject("testObject", {appc: "rocks"})
Ti.API.warn(Ti.App.Properties.getObject("testObject", {appc: "rocks"}));
 
Ti.App.Properties.setList("testList", ["appc", "rocks"])
Ti.API.warn(Ti.App.Properties.getList("testList", ["appc", "rocks"]));
 
// Check the properties again. It should now include the keys of the custom properties
Ti.API.warn(Ti.App.Properties.listProperties());
 
// Remove all custom properties
Ti.API.warn(Ti.App.Properties.removeAllProperties());
 
// Check the properties a last time. The custom properties should not be included anymore
Ti.API.warn(Ti.App.Properties.listProperties());

Comments

  1. Kota Iguchi 2016-11-03

    https://github.com/appcelerator/titanium_mobile_windows/pull/890
  2. Samir Mohammed 2016-12-22

    Verified improvement with the code provided in the description; .removeAllProperties() showed no properties. *Environment*
       Nokia Lumia 640 LTE (RM-1073)
       version 1607
       OS Build: 10.0.14393.576
        
       Operating System
       Name                        = Microsoft Windows 10 Pro
       Version                     = 10.0.14393
       Architecture                = 64bit
       

    CPUs = 4

    Memory = 17034395648 Node.js Node.js Version = 4.4.4 npm Version = 2.11.3 Titanium SDK SDK Version =6.1.0.v20161222061413
    Closing ticket.

JSON Source