Using iOS 5 Twitter API to send private message?

2019-05-06 15:03发布

Can iOS 5 Twitter API be used to send a private (direct) message? I can't seem to find out how.

标签: ios twitter
1条回答
成全新的幸福
2楼-- · 2019-05-06 15:47

You can't edit the text that the User sends via the Twitter Compose window but you can set the initial text using the setInitialText: method and use the Twitter DM Syntax. The Twitter DM Syntax is described here

TWTweetComposeViewController *controller = [[TWTweetComposeViewController alloc] init];
[controller setInitialText:@"d some-twitter-username Something I want to tweet";

You can't modify the window or the tweet once the view is shown so you can't tack it on at the end when the User presses Send. The Twitter Framework doesn't abstract DM'ing out of the box with all the features such as choosing who to send to but using this Twitter DM Syntax works just fine if you know the recipient or ask the User to input the Username of the recipient after the d

查看更多
登录 后发表回答