【发布时间】: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