I want to check in using facebook android sdk (graph api),
I am trying this
String checkinData = "{"+
"\"message\"=\"Test\"" +
"\"place\"=\"000000000\""
+ "\"coordinates\"={\"latitude\":\"000000000\", \"longitude\":\"-000000000\"}\"" + "}";
Bundle params = new Bundle();
params.putString("checkin", checkinData);
String pageData = "";
try {
pageData = facebook.request("/checkins", params, "POST");
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Data : " + pageData);
But its giving me this error
{"error":{"message":"batch parameter must be a JSON array","type":"GraphBatchException"}}
is this correct way to check in using facebook graph api
Simple code for checkins . Try this :
Bundle params = new Bundle();
params.putString("access_token", "YOUR ACCESS TOKEN");
params.putString("place", "203682879660695"); // YOUR PLACE ID
params.putString("message","I m here in this place");
JSONObject coordinates = new JSONObject();
coordinates.put("latitude", "YOUR LATITUDE");
coordinates.put("longitude", "YOUR LONGITUDE");
params.putString("coordinates",coordinates.toString());
params.putString("tags", "xxxx");//where xx indicates the User Id
String response = faceBook.request("me/checkins", params, "POST");
Log.d("Response",response);
Probaly is the checkinData format. Try:
String checkinData = "{"+
"\"message\":\"Test\"," +
"\"place\":\"000000000\","
+ "\"coordinates\":{\"latitude\":\"000000000\", \"longitude\":\"-000000000\"}\"" + "}";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With