私は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でツイートを投稿します。
承認後にこれを行う最善の方法は何ですか?
ありがとうございました。 https://developer.xamarin.com/guides/ios/platform_features/introduction_to_the_social_framework/
アンドロイド、iOSの、またはクロスプラットフォームのために、あなたはLinqToTwitter(https://github.com/JoeMayo/LinqToTwitter/wiki)のようなものを使用することができます:あなたはiOSので作業している場合は
Xamarin.Authは別名Twitterの/上の既存のユーザーとして人を検証する認証のためだけのライブラリ(です。 ..)。実際の投稿には、twitters自身のapiを使用する必要があります。 –