Storing global/application variables
Hi all,
I've managed to get the xAuth authentication working for Twitter. I retrieve the oauth_token and oauth_secret_token which I can then use for future Twitter functions in my app.
What I want to do is to store these two token's in an application variable or global variable so I can call on them from functions that I'll build.
Could someone advise how I'd store these and then retrieve them.
I've tried Ti.App.token = 'tokenvalue'; but didn't seem to work.
Hope you can help
Paul
3 Answers
-
Accepted Answer
Hi, this could give you some ideas
http://developer.appcelerator.com/blog/2010/06/how-to-persist-complex-javascript-objects.html
-
Ti.App.token should work, I use it in my apps.
What do you get if you do Ti.API.info(Ti.App.token) somewhere else in you app?
You could also use Titanium.App.Properties that can also save the token between sessions if that is wanted.
If you want more help, I'll need to see the code.
-
Cheers Tamas and Sindre. Both answers just what I needed, and I have it working.