简体   繁体   English

使用iOS 5 Twitter API发送私信?

[英]Using iOS 5 Twitter API to send private message?

Can iOS 5 Twitter API be used to send a private (direct) message? 可以使用iOS 5 Twitter API发送私人(直接)消息吗? I can't seem to find out how. 我似乎无法弄清楚如何。

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. 您无法编辑用户通过Twitter Compose窗口发送的文本,但您可以使用setInitialText:方法设置初始文本并使用Twitter DM语法。 The Twitter DM Syntax is described here 这里描述 Twitter DM语法

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 Twitter框架没有提供开箱即用的DM'开头即时功能,例如选择发送给谁但使用此Twitter DM语法如果您知道收件人或要求用户输入收件人的用户名就可以正常工作在d

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM