Вопрос

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.

Это было полезно?

Решение

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];

Другие советы

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];
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top