【问题标题】:share twitter detail throughout the app在整个应用程序中分享 Twitter 详细信息
【发布时间】:2014-03-14 20:47:42
【问题描述】:

我正在我的 IOS 应用程序中实现 twitter 分享。我使用 MGTwitterEngine。如果我从同一个控制器实现登录和共享,它可以工作,但如果我在 2 个控制器中分离出登录和共享功能,它就不能工作。

SA_OAuthTwitterEngine *_engine;

_engine 返回空白。

【问题讨论】:

    标签: ios twitter login share


    【解决方案1】:

    如果您的目标是 iOS6 或更高版本,则最好使用 iOS 社交 API:

    - (IBAction)postToTwitter:(id)sender {
        if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
        {
            SLComposeViewController *tweetSheet = [SLComposeViewController
                                                   composeViewControllerForServiceType:SLServiceTypeTwitter];
            [tweetSheet setInitialText:@"Great fun to learn iOS programming at appcoda.com!"];
            [self presentViewController:tweetSheet animated:YES completion:nil];
        }
    }
    

    更多信息请看这里:http://www.appcoda.com/ios-programming-101-integrate-twitter-and-facebook-sharing-in-ios-6/

    【讨论】:

    • 我不想展示评论控制器。我想在没有 presentViewController 的情况下发送帖子。这可能吗?
    • 使用社交框架也许是可能的,但不是那么容易。您可能必须走低得多的级别,因此使用 MGTwitterEngine 并复制一些示例可能会更容易。如果我没记错的话,使用 MGTwitterEngine 的缺点是没有与设备上的用户配置文件集成。
    猜你喜欢
    • 2019-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-25
    • 2018-07-06
    • 2011-11-19
    相关资源
    最近更新 更多