Working twitter-client+oauth example code ?

Hi,
I’m not sure if I’m doing something wrong…
Anyway, I’m testing Twitter posting from my app and I’ve used the code on technority.
It works, and I can post message to twitter. However, every time I relaunch the app and post to twitter it’s showing me the “Authorize … to use your account?”.

Shouldn’t the authorization phase just be the first time?

Do we need to save some data to enable the app to be authorized and don’t require the same authorization dialog every time ?

Or… Am i doing something wrong?

Thanks :wink:
Ruben [import]uid: 9158 topic_id: 8375 reply_id: 45302[/import]

I believe I have had to do that as well, I haven’t actually noticed - someone else may be able to shed some light.

Peach :slight_smile: [import]uid: 52491 topic_id: 8375 reply_id: 45413[/import]

ARGH! It turns out, the oauth.lua offered here:
http://developer.anscamobile.com/code/oauth-library

is NOT AT ALL THE SAME as the oAuth.lua I found here:
http://techority.com/2011/05/26/post-to-twitter-from-your-application/

The second one is the right one. The first one fails! The posting at:
http://developer.anscamobile.com/code/oauth-library
should be removed! Or the library fixed! And, the library should be easily found on the Corona website!

Argh, I say, again! [import]uid: 37366 topic_id: 8375 reply_id: 45496[/import]

So basically, after the user authorizes my application using the webpopup, I need to save the access_token and the access_token_secret in my app, and later, when I want to post to twitter I’m simply using oAuth.makeRequest ?

request\_response = oAuth.makeRequest("http://api.twitter.com/1/statuses/update.json", params, consumer\_key, access\_token, consumer\_secret, access\_token\_secret, "POST")  

is it ok?

It’s working… just wondering if it’s the correct procedure…

Oh, and yes, the example on code share is different… This oAuth library is very very important and should be explained better somewhere on the website… [import]uid: 9158 topic_id: 8375 reply_id: 45531[/import]

I cannot seem to find the setting that insures that my app is a browser app vs a native app. Any ideas or advice? [import]uid: 13050 topic_id: 8375 reply_id: 49141[/import]

Twitter ended up just changing the UI with the relaunch so that this is no longer an explicit setting. In fact, as long as you specify a callback URL (which you do in the “Settings” tab of “My applications”), then you’ve implicitly set your application type as browser. Even if you’re callback URL is just a placeholder.

This has not, however, resolved the lingering popup or lack of tweet. [import]uid: 13050 topic_id: 8375 reply_id: 49145[/import]

Could you further clarify how you are saving your keys and on which conditions? Thanks :slight_smile:

This makes three posts in a row. I’m sorry. [import]uid: 13050 topic_id: 8375 reply_id: 49152[/import]

would be great if this would be fixed in samples once and for all :slight_smile: [import]uid: 111283 topic_id: 8375 reply_id: 124987[/import]

would be great if this would be fixed in samples once and for all :slight_smile: [import]uid: 111283 topic_id: 8375 reply_id: 124987[/import]

I just try the daily build 919. Base on the sample code that I can get the twitter app work and post to twitter. But this app sample only post to my app page instead of app user’s twitter page.

And also it did not ask for app user’s password and user name. Is this behavior correct?
So that mean the app user will only post tweet to my app page instead of their own page.

Did I do anythings wrong?

kc [import]uid: 94613 topic_id: 8375 reply_id: 125444[/import]

I just try the daily build 919. Base on the sample code that I can get the twitter app work and post to twitter. But this app sample only post to my app page instead of app user’s twitter page.

And also it did not ask for app user’s password and user name. Is this behavior correct?
So that mean the app user will only post tweet to my app page instead of their own page.

Did I do anythings wrong?

kc [import]uid: 94613 topic_id: 8375 reply_id: 125444[/import]