0
當試圖從一個原生的Android應用程序發佈到Facebook的一個活動,我獲得以下響應執行請求後:對OG要求空graphobject
{
Response: responseCode: 200,
graphObject: null,
error: {
HttpStatus: -1,
errorCode: -1,
errorType: null,
errorMessage: null
},
isFromCache: false
}
我的應用程序從用戶獲取的publish_action權限。
public void publishActivity(){
session = Session.getActiveSession();
openSession();
Bundle params = new Bundle();
params.putString("highest", "http://www.my-url.com/graph.html");
Request request = new Request(
Session.getActiveSession(),
"me/namespace:play",
params,
HttpMethod.POST
);
Response response = request.executeAndWait();
Log.d("DEBUG",response.toString());
}
public void openSession(){
if(session.isClosed()){
Session.OpenRequest openRequest = new Session.OpenRequest(GameActivity.get());
openRequest.setPermissions(PERMISSIONS);
session.openForPublish(openRequest);
}
}
(我更換了網址和名稱空間。在我的代碼,他們是正確的。)