0

I am currently working on integrating twitter to my app,i try to do some research about reply twitter post.I know how to do it using SLRequest but its has no UI. So, I want to use SLComposeViewController ui for reply. Do you guys any suggestion? Thanks!

Siti
  • 130
  • 7

1 Answers1

0

In the case of replying to a specific tweet, check out this answer here: Is there a way of replying to a particular tweet via SLComposerViewController

So in addition to using the SLComposeViewController, like you would below, you will need to pass a few additional parameters including "in_reply_to_status_id". The above link explains this in detail.

You would want the reply button to trigger something like this:

-(IBAction)TweetPressed{
  if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
  {
      SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
      [tweetSheet setInitialText:@"@USERNAME_TO_REPLY_TO"];
      [self presentViewController:tweetSheet animated:YES completion:nil];

  }
  else
  {
      UIAlertView *alertView = [[UIAlertView alloc]
                                initWithTitle:@"Sorry"
                                message:@"You can't send a tweet right now, make sure your device has an internet connection and you have at least one Twitter account setup"
                                delegate:self
                                cancelButtonTitle:@"OK"
                                otherButtonTitles:nil];
      [alertView show];
  }
}

There is a full tutorial available here: http://ios-blog.co.uk/tutorials/integrating-social-media-in-your-apps/

Community
  • 1
  • 1
ateich
  • 520
  • 3
  • 10
  • i already try it but it is not working because it will goes to post not a reply post – Siti Dec 12 '14 at 17:55
  • For replying to tweets, check out this answer: http://stackoverflow.com/questions/16815180/is-there-a-way-of-replying-to-a-particular-tweet-via-slcomposerviewcontroller – ateich Dec 12 '14 at 18:06
  • i already try but when i try to get view.subview is empty. i didnt get the button view – Siti Dec 17 '14 at 14:09