イメージを作成する Android アプリケーションがあります。
この画像を Facebook ページのアルバムに追加します (個人のウォールには追加しません)。
app tokenを使用する必要があることがわかりました。
私はアプリトークンを取得します:
https://graph.facebook.com/oauth/access_token?
client_id=MY_APP_ID
&client_secret=MY_APP_SECRET
&grant_type=client_credentials
そして、このアプリトークンを使用して、次のコードを使用する必要があると思います:
String appToken="MY_APP_TOKEN";
facebook.setAccessToken(appToken);
Bundle parameters = new Bundle();
parameters.putString("caption", "This is a message test...");
byte[] ImageBytes=...;
parameters.putByteArray("photo", ImageBytes);
String response2=facebook.request("ALBUM_ID/photos", parameters, "POST");
このコードは次のエラーを返します。
A user access token is required to request this resource
それでは、アプリトークンを使用してはいけませんか? ありがとう