https://graph.facebook.com/profile-id/checkins?access_token=access_token&message=「辦公室」出版簽入使用Facebook的圖形API
我使用上面的圖形API,發佈我的飼料籤,我想這對我的瀏覽器, 我得到空數組作爲響應,我還使用了圖形api資源管理器中的access_token,它允許使用(publish-checkins)。
我越來越像下面
{
"data": [
]
}
https://graph.facebook.com/profile-id/checkins?access_token=access_token&message=「辦公室」出版簽入使用Facebook的圖形API
我使用上面的圖形API,發佈我的飼料籤,我想這對我的瀏覽器, 我得到空數組作爲響應,我還使用了圖形api資源管理器中的access_token,它允許使用(publish-checkins)。
我越來越像下面
{
"data": [
]
}
final JSONObject jsonobj;
try {
jsonobj = new JSONObject();
jsonobj.put("latitude", fetLatitude);
jsonobj.put("longitude", fetLongitude);
final String message;
final String name = fetPlaceName;
final String placeID = fetPlaceID;
if (edittxtMessageBox != null){
message = edittxtMessageBox.getText().toString();
} else {
message = "I am at: " + fetPlaceName + " using MyAppName";
}
new AlertDialog.Builder(this).setTitle(R.string.check_in_title)
.setMessage(String.format(this.getString(R.string.check_in_at), name))
.setPositiveButton(R.string.checkin, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Bundle params = new Bundle();
params.putString("place", placeID);
params.putString("message", message);
params.putString("coordinates", jsonobj.toString());
Utility.mAsyncRunner.request("me/checkins", params, "POST",
new placesCheckInListener(), null);
}
}).setNegativeButton(R.string.cancel, null).show();
} catch (Exception e) {
e.printStackTrace();
}
k,如何獲得地點id。 – user1891910
@ user1891910:在我的應用程序中,當用戶選擇「簽入」選項時,他會看到一個可供選擇的地方列表。當選擇時,'place_id'和'座標'通過一個'Intent'發送到我使用上面提到的代碼的活動中。你需要在這些線上做些事情。如果你想做_fake checkins_,你可以使用靜態的'place_id'和'co-oridinates'。 –
我必須使用我自己的名字進行登記,例如「辦公室」,「健身房」,....這樣的話。那麼這個placeid是什麼以及如何創建這些,以及爲什麼要使用座標參數 – user1891910
要發佈一個簽入的響應,你必須提供一個'place_id'檢入到。在這裏查看Checkins Create部分:https://developers.facebook.com/docs/reference/api/user/ –
我只想做一些假簽入(如在辦公室),如何獲得地點id以及什麼是使用座標參數,如果我只是想做假簽入 – user1891910
檢查我發佈的答案。這是我如何使用FB SDK V 2x來完成的。尚未遷移到V 3.x。你將不得不調整我的代碼來使用新的SDK(也許)。 –