Shizam
Shizam

Reputation: 9672

How can you get the Tweet you just Tweeted using iOS's libraries and TWRequest?

I successfully tweet a message and in the result block successfully make a request to statuses/user_timeline.json and it returns my most recent tweets. The problem is, the tweet I just made isn't in the result set, only older tweets.

How can I get the information for the tweet I just made using TWTweetComposeView?

Thanks

EDIT: For now I'm making a statuses/user_timeline.json (count=1) request before sending the tweet so I know the ID of the last tweet made, in the result block of TWTweetComposeView I then start making requests to statuses/user_timeline.json with since_id=thepreviousid until I get a result containing at least 1 tweet... lame.

Upvotes: 0

Views: 240

Answers (1)

Matt Garrod
Matt Garrod

Reputation: 878

When you tweet using the statuses/update.json twitter API call, the tweet is returned in the response.

-[TWRequest performRequestWithHandler] will provide an NSData object that can be converted to NSString and then parsed to provide the details of the submitted tweet.

Upvotes: 2

Related Questions