Help with Twitter

I’m trying to add tweeting to an app I’m working on and I’ve hit a couple of issues that are throwing me for a bit of a loop.

One involves the access token, but I think I just found my problem there… It’s amazing how many times I’ll be typing out a forum post and find my problem while trying to explain it… Its a service I bet you didn’t know the forums even provided :slight_smile:

Any way, the other has to do with the call back URL processing.

My app brings up the login screen. I put in my name and password but it seems that delegate.twitterCancel() gets called and the login window stays open (or reopens… there seems to be a blink in there).

The code from the sample app has this basic structure in it:

if url:find("oauth\_token") and url:find(webURL) then  
 -- some code extracting the URL's query string, it looks., grabs the access token, and sends the tweet.  
elseif url:find(webURL) then  
 delegate.twitterCancel()  
end  

In my case, webURL is a global and its an empty string, which in a previous forum post, it was suggested that was a fix. There wasn’t a call back URL put in when the AppID was created.

First, is url:find() basically telling me that all of the string api calls are available on all strings? I didn’t know that a generic string had those methods (much like JavaScript). If so that’s really cool.

Secondly, is url:find("") returning true?

What’s going on to cause this cancel to happen? [import]uid: 19626 topic_id: 27828 reply_id: 327828[/import]

Update…

On the simulator, it never prompts me to login, but seems to think it sends the tweet anyway, even though auth_token and all those items are nil. Assumption, doesn’t work on the simulator. So I build for device and I get it prompting me to login, then cancelling the send as above.

The URL I get back on device is:

https://api.twitter.com/oauth/authorize

On the simulator I get:

http://api.twitter.com/oauth/authorize?oauth_token=0rPj133XkMURpu2FBuAWIPsqzeQP7bcuWYNqZICMbo

The code looks for the ?oauth_token to assume the login was not cancelled. I’m 99.9% sure I entered my password correctly, so any one have any ideas???

I’d really like to get this working.

UPDATE: I created my own app ID and provided a call back URL just to test and it seems to go through the process on the simulator and on device fine and it says it successfully tweeted the message, however I never see the tweets. Any one?

Thanks in advance,
Rob [import]uid: 19626 topic_id: 27828 reply_id: 112785[/import]

I finally resolved my problem. Sometimes it helps to walk away and answer someone else’s questions…

When you go to the twitter API site and create your app, there are more options “below the scroll”. One of them is a setting to determine what privileges your app has. The default is “Read Only” and the Sample Twitter app ignores the results coming back and just sees a successful API call, not the fact that there was an error in the response data.

Once uncommented those prints in the sample app that shows the response, I saw a permission error, went to twitter, fixed it, and volia I’m a tweetin’

[import]uid: 19626 topic_id: 27828 reply_id: 113272[/import]

@Rob,

Would you mind trying to help me out with something almost like you`ve passed?

So, I do not understand nothing right now because I have exactly 3 apps setup with Twitter and the last one of them (the 3rd) that has all the settings exactly the same as the other 2 (that are working nicely) but the 3rd just went live today on Appstore but it does not send the tweet or better, I cannot find it anywhere into my Twitter`s timeline. However looking into the logs (Organizer for example) I do see the message “Twitter successfully sent!” o.O

Well, what could be my problem here?

PS: Ive compared line-by-line my .luas Twitter related files and there are no differences between then besides only my “specific`s app keys”.
Thank you anyway,

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 27828 reply_id: 119725[/import]

With out seeing your code or screen shots of your app settings, it’s going to be really hard to provide any advice. I’m also traveling this week and have limited network connectivity.

If you can gather up the resources I can try and help when I get back to civilization next week. [import]uid: 19626 topic_id: 27828 reply_id: 119885[/import]

@Rob,

Thanks!

Not a problem to wait for you to return home btw.

My app is already live but this thing (twitter) just does not work and so I have to “repair” it to upload an update for Apple anyway.

When you get back just advice and I`ll share what is necessary with you without problem as well.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 27828 reply_id: 119943[/import]

@Rob,

Would you mind trying to help me out with something almost like you`ve passed?

So, I do not understand nothing right now because I have exactly 3 apps setup with Twitter and the last one of them (the 3rd) that has all the settings exactly the same as the other 2 (that are working nicely) but the 3rd just went live today on Appstore but it does not send the tweet or better, I cannot find it anywhere into my Twitter`s timeline. However looking into the logs (Organizer for example) I do see the message “Twitter successfully sent!” o.O

Well, what could be my problem here?

PS: Ive compared line-by-line my .luas Twitter related files and there are no differences between then besides only my “specific`s app keys”.
Thank you anyway,

Cheers,
Rodrigo. [import]uid: 89165 topic_id: 27828 reply_id: 119725[/import]

With out seeing your code or screen shots of your app settings, it’s going to be really hard to provide any advice. I’m also traveling this week and have limited network connectivity.

If you can gather up the resources I can try and help when I get back to civilization next week. [import]uid: 19626 topic_id: 27828 reply_id: 119885[/import]

@Rob,

Thanks!

Not a problem to wait for you to return home btw.

My app is already live but this thing (twitter) just does not work and so I have to “repair” it to upload an update for Apple anyway.

When you get back just advice and I`ll share what is necessary with you without problem as well.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 27828 reply_id: 119943[/import]