RyanShay
Posts: 0
Joined: Mon Mar 12, 2012 2:29 am

Tiggr.persistentStorage example

Can you provide a simple example of how to set a variable via Tiggr.persistentStorage?

Just as a quick test, I'm trying to implement a counter that increases each time the application is run.

var count = parseFloat(Tiggr.getItemFromStorage('count'));
if (isNaN(count)){ count = 0;}
alert(count);
Tiggr.Storage('count',count+1);

I also tried Tiggr.persistentStorage('count',count+1); with no luck either. Hopefully you can point me in the right direction.

Thanks.

RyanShay
Posts: 0
Joined: Mon Mar 12, 2012 2:29 am

Tiggr.persistentStorage example

Also as a note, this is inside of an init function that doesn't get fired until after OnDeviceReady.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Tiggr.persistentStorage example

Just use Local Storage directly.

RyanShay
Posts: 0
Joined: Mon Mar 12, 2012 2:29 am

Tiggr.persistentStorage example

Does local storage persist between application executions? I thought I read in the api docs that it did not.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Tiggr.persistentStorage example

Yes, it will persist.

Return to “Issues”