-2
我是android開發新手。我正在嘗試將照片從Android應用發佈到用戶的臉書相冊。我添加下面的代碼我在用戶登錄的權限「user_friends」如何使用以下圖形API從Android應用程序上傳照片到Facebook相冊?
new GraphRequest(
MainFragment.mAccessToken.getCurrentAccessToken(),
"/me/photos",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
// This is my code for user login at app start
post = (Button)view.findViewById(R.id.button1);
mLoginManager = LoginManager.getInstance();
mLoginManager.registerCallback(mCallbackManager, mCallback);
mLoginManager.logInWithReadPermissions(this, Arrays.asList("user_friends")); //user_friends // publish_actions
後請指引我
爲什麼user_friends?做什麼的?你只需要publish_actions。 – luschn
也,你忘了提及最重要的信息:究竟是什麼問題? – luschn
對不起。我錯過了很多信息。但是,我能夠找到問題並編寫工作代碼。我忘了executeAsync() –