我正在使用Xamarin.Auth与Twitter进行身份验证。我使用下面的代码来授权:发布推文[Xamarin.Android]
private void LoginTwitter() {
var auth = new OAuth1Authenticator(
consumerKey: "KEY",
consumerSecret: "SECRET",
requestTokenUrl: new Uri("https://api.twitter.com/oauth/request_token"),
authorizeUrl: new Uri("https://api.twitter.com/oauth/authorize"),
accessTokenUrl: new Uri("https://api.twitter.com/oauth/access_token"),
callbackUrl: new Uri("http://mobile.twitter.com")
);
auth.Completed += twitter_auth_Completed;
StartActivity(auth.GetUI(this));
}
private void twitter_auth_Completed(object sender, AuthenticatorCompletedEventArgs eventArgs) {
if (eventArgs.IsAuthenticated) {
Toast.MakeText(this, "Logged in!", ToastLength.Long).Show();
}
}
授权正在工作,但我现在想要在Twitter上发布推文。
授权后做这件事的最好方法是什么?
谢谢。
Xamarin.Auth仅仅是Authentication(也就是检验一个人是在Twitter上的现有用户/库。 ..)。对于实际发布,你必须使用twitters自己的api。 –