twitter

Twitter がインストールされているかどうか確認してからツイートする

まずは Twitter がインストールされているかどうかをこんなコードで調べる。 出典はココ。 boolean appInstalledOrNot(Context context, String uri) { PackageManager pm = context.getPackageManager(); boolean app_installed = false; try { pm.getPacka…

Twitter しか反応しないじゃん!

最初、"twitter://" を使えば Android機にインストールされている "twitter://" に対応するアプリ一覧が表示されて、そこから好きなアプリを選んで起動できるんじゃないか?なんて夢を見てしまった。 でもそんな結果にはならずに、"twitter://" に反応するア…

TWRequest に渡すURLを変更して解決

実際に TWRequest 作っている部分はこんな感じ。 // Create a request, which in this example, posts a tweet to the user's timeline. // This example uses version 1 of the Twitter API. // This may need to be changed to whichever version is curre…

sendCustomTweet してみる

アカウントを取得したら後はツイートするだけ。 ざっくりこんな感じで。 - (IBAction)tweet:(id)sender { ACAccountStore *accountStore = [[ACAccountStore alloc] init]; ACAccount *twitterAccount = [accountStore accountWithIdentifier:self.userID]; …

Twitter アカウントの取得

ざっくりこんな感じで。 - (IBAction)showAccount:(id)sender { // Create an account store object. ACAccountStore *accountStore = [[ACAccountStore alloc] init]; // Create an account type that ensures Twitter accounts are retrieved. ACAccountTy…