2

在我的应用程序中,我希望允许我的用户将单个状态发布到 Facebook 和 Twitter。我有自己的撰写窗口,所以我想避免使用内置的SLComposeViewController,因为它不是必需的。

在我的搜索中,我没有找到任何关于如何使用 iOS6 的东西直接发布到 Twitter 或 Facebook 的好的教程,这些都是内置的作曲家,而且这些文档对我疲惫的眼睛来说有些迟钝。

任何指向教程、示例代码甚至是正确方向的指针都将不胜感激。

4

2 回答 2

1

Grab both the user's Twitter and Facebook accounts from ACAccountStore, and then just make two calls to SLRequest--one for your Twitter post and another for Facebook.

Here's the class reference for SLRequest.

And check out these examples for Facebook and Twitter.

It's also worth noting that Facebook has their own SDK alternative to SLRequest, which allows for more customization of requests to include FQL, batch requests, etc. Depending on the specificity of your requirements, you may want to check it out.

于 2013-05-21T03:34:20.803 回答
0

使用 ACAccountStore 检查是否在用户的 iPhone 设置中配置了 Facebook 和 twitter,然后使用 Graph api for facebook 和 twitter rest api for Twitter 发布/推文而不使用 SLRequest 类显示 UI。对于 facebook,您还必须在它的[开发者门户]:https ://developers.facebook.com/apps 。

于 2013-06-03T18:31:44.793 回答