2

I know that how to send custom tweet using SLRequest and TWRequest but i didn't get link when i post message and link. I got only message.

The code is:

  NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"Send to text",@"status",@"http://stackoverflow.com/",@"link", nil];
  SLRequest *slRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"http://api.twitter.com/1.1/statuses/update.json"] parameters:dict];
 [slRequest setAccount:account];//account is ACAcount type object

 [slRequest performRequestWithHandler:^(NSData *responseData,NSHTTPURLResponse *urlResponse, NSError *error){
                                NSLog(@"The responseString:%@",[[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);

                            }];

I think the problem is at key value for sending link . Here i am using 'link' key. Please help me.

Prasad G
  • 6,702
  • 7
  • 42
  • 65

2 Answers2

3

There no parameter like link for update URL . you need to append your URl to status and set true for wrap_links parameter.It will work

//change your dict like below
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:[NSString stringWithFormat:@"Send to text http://stackoverflow.com/"],@"status",@"true",@"wrap_links", nil];
Lithu T.V
  • 19,955
  • 12
  • 56
  • 101
Narayana Rao Routhu
  • 6,303
  • 27
  • 42
0

same goes with the Facebook SLRequest except that the key for 'status' is 'message'.

NSDictionary *parameters = [[NSDictionary alloc] initWithObjectsAndKeys:[NSString stringWithFormat:@"Hey %@ check this out http://stackoverflow.com/", self.label.text],@"message",@"true",@"wrap_links", nil];
John Paul Manoza
  • 1,735
  • 25
  • 22