Need tweet id after posting tweet through iOS app

ios
objective-c

#1

How can I get tweet id of the tweet.I am using the following code

TWTRComposer *composer = [[TWTRComposer alloc] init];

[composer setText:@"just setting up my Fabric"];
[composer setImage:[UIImage imageNamed:@"fabric"]];

// Called from a UIViewController
[composer showFromViewController:self completion:^(TWTRComposerResult result) {
    if (result == TWTRComposerResultCancelled) {
        NSLog(@"Tweet composition cancelled");
    }
    else {
        NSLog(@"Sending Tweet!");
    }
}];

#2

Hey @sandeepsingla90,

Take a look here which offers a few different ways of getting tweet ids.


#3

In my understand the links don’t really show how to get the ‘id’. they all seem to have the id" : @“20” (example: https://docs.fabric.io/apple/twitter/access-rest-api.html)?

In other words, when we POST from our app, how do we get the id of that post so that we can GET it later for other use (not interested in getting the last tweet or an array of tweets, just need the specific tweet uniquely identified by its id)?
Thanks!


#4

Hi @stefanodigenua
Do you could get the tweet id after post a tweet with TweetComposer?


#5

Nope. The response does not contain this data unfortunately. So what I did was to check for the last tweet and get the id from this response. This results in 2 requests to the API but I did not find a more efficient solution unfortunately. Any better ideas are welcome…