【问题标题】:SLRequest with C# in Xamarin.iOS project returned code:215 Bad AuthenticatedXamarin.iOS 项目中使用 C# 的 SLRequest 返回代码:215 Bad Authenticated
【发布时间】:2015-08-16 15:17:42
【问题描述】:

我在 http://docs.xamarin.com/guides/ios/platform_features/introduction_to_the_social_framework/ 上尝试了 xamarin.iOS 的示例

但是

twitterRequestButton.TouchUpInside += delegate {

            if (SLComposeViewController.IsAvailable (SLServiceKind.Twitter)) {

                var parameters = new NSDictionary ();
                var request = SLRequest.Create (SLServiceKind.Twitter,
                                                SLRequestMethod.Get,
                    new NSUrl ("http://api.twitter.com/1.1/statuses/public_timeline.json"),
                                                parameters);

                request.PerformRequest ((data, response, error) => {

                    if (response.StatusCode == 200) {
                        InvokeOnMainThread (() => {
                            resultsTextView.Text = data.ToString (); });

                    } else {
                        InvokeOnMainThread (() => {
                            resultsTextView.Text = "Error: " + response.StatusCode.ToString (); });
                    }
                });
            }
        };

此 SLRequest 返回 215 代码;身份验证错误。

我不知道为什么。

我想做的就是获取特定用户的时间线,所以如果您对此有任何想法,请帮助我。

【问题讨论】:

  • 您是否在“设置”应用中设置了 Twitter 身份验证设置?您是尝试从模拟器还是设备上执行此操作?
  • 谢谢 Jason,是的,我在 iOS 模拟器的设置应用程序中设置了我的社交帐户,我可以发布推文和 Facebook,但无法获取时间线。

标签: xamarin.ios xamarin xamarin-studio


【解决方案1】:

好吧——一方面,statuses/public_timeline 不作为其 API 1.1 版的端点存在。也许你喜欢https://dev.twitter.com/rest/reference/get/statuses/user_timelinehttps://dev.twitter.com/rest/reference/get/statuses/home_timeline

【讨论】:

    猜你喜欢
    • 2013-10-05
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 2020-11-12
    相关资源
    最近更新 更多