twitterのOAuth認証ではまったこと
最近twitter APIを使ってOAuth認証しようとしたら、以下のようなエラーが出てハマった。
Callback URL not approved for this client application.
これは、callback URLが間違ってるよみたいなこと
2018.6.13以降はちゃんと対応させないとだめになった
なので、アプリ登録したページから、以下のcallback URLを設定
https://developer.twitter.com/en/apps
その後、ソースを変更
twitter.getOAuthRequestToken("app://");
AndroidManifest.xml
も設定してたら変更
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="app" /> </intent-filter>
これでヨシ
参考URL