Twitterではベーシック認証は去年の6月で廃止されたので、使えません。
(そもそもセキュリティ的に危ないし)
その他の方法、となると、oauthか、xauth認証となるようです。
oauthは以下のアドレスから登録できます。
https://dev.twitter.com/apps
しかし、xauthの場合はtwitterに英語でメールして認証してもらわないといけません。
これはめんどくさそう。。
なので、oauthでできないものかと調べてみると、以下のライブラリがあるみたい。
Twitter-OAuth-iPhone
参考:
TwitterのOAuth認証を使う - 強火で進め
ダウンロードしてみて、demoフォルダ内のもので試してみたのだけれど、xCode4.3だと、
warninigがでまくり。
また、いちいち、twitterページを開いて、認証させる作業が必要な模様。
それに比べて、xauthの場合は、アプリ内にIDとパスワードを保存させておいて、それを使ってログインしたままにできるよう。
(セキュリティ的な意味ではaouthの方がいいみたいだけど)
なので、xauthを申請してみることにした。
申請を行っている方はたくさんいて、その内容の例を示してくれている。
それらを大いに参考にさせていただいて、メールを送ってみた。
タイトル :
xauth request - iPhone Application
内容:
----
Hello.
I'm developing 'アプリ名', アプリの説明
for iPhone application.
Please look at screenshot images here.
スクリーンショットのURL
Please apply this app to use xAuth.
My account is @twitterユーザー名.
https://dev.twitter.com/apps/アプリID
Application: アプリ名
I want to add a tweet function to the iPhone application.
Best regards.
----
スクリーンショット画像はメールで添付できない、とのことで
自分のサーバにアップして、そのURLをはりつけました。
すると、以下のようなメールが帰ってきました。
たぶん、自動返信かと思われます。
Hello,
We've received your email regarding xAuth access and someone from our team will review your request as soon as possible.
Our review will proceed much more quickly if you were to reply to this ticket with the following information: • Your App ID number (or consumer key) from https://dev.twitter.com/apps/ • A link to your application’s website • Links to screenshots of your application's user-facing Twitter functionality • Links to screenshots of your application in use
Please note that our ticketing system does not accept attachments, so please upload your screenshots to your server or an image host. If you have already provided the required information in your initial request, please respond to this ticket to affirm that the required information is present.
For your application to qualify for xAuth access, it must be production-ready and only accessible via standalone desktop application or via mobile. We do not grant xAuth for testing purposes, single-user applications, or for applications that are in the early stages of development.
If you are not requesting xAuth access and have received this response in error, please let us know by responding to this ticket. If you have a technical question about the API, please check out our documentation: http://dev.twitter.com/doc
This ticket will automatically close if we do not receive a response from you within one week.
Thanks, Twitter API Policy |
|
|
つたない英語力と自動翻訳に頼って読んでみると、
・アプリIDもしくは、コンシュマーIDを書いてね
・アプリのURLを書いてね
・twitterに投稿する時のスクリーンショットを送ってね
・アプリのスクリーンショットを送ってね
みたいな内容。
さらに、これに1週間以内に返信してくれないと、この件はなかったことにするからね、とも。
けど、最初に送った内容でほぼカバーしてる。
なので、最初に送った内容とほぼ同じことを返信しといた。
結果はここに追記で書きたいと思います。
メールの参考にさせてもらった記事(多謝!)
Hello,
Thank you for your interest in xAuth. Unfortunately, we are not granting xAuth for development purposes. Instead, we recommend that you set up a one-time OAuth workflow to obtain the access token for a single account, and then store that token to authorize your API calls during this initial development stage. We even provide a tool on our developer site to make this process easy:https://dev.twitter.com/docs/auth/oauth/single-user-with-examples . Twitter does not expire access tokens unless the user revokes access to the application, or the application is suspended for violating policy. We apologize for any inconvenience that this causes to you and your project. Please let us know when you have a more production-ready version of your application, or if you have any other questions.
Thanks, Twitter API Policy |
|
|
内容は、開発段階ではxAuthの許可はできないよ。oauthあるし、そっち使ってね、みたいな。
また、xauth用に準備できたら再申請してね、みたいな。
ググってみると同じメールで拒否されてる人が結構いる。
とりあえず、oauthでやってみますか。。
それかこの辺を参考にもっかい申請してみるか。
とりあえず、先にアプリ作るのが先決ですかね。