How to check the use of facebook android sdk (graph api)

I want to check with facebook android sdk (graph api),

I'm 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 it gives me this error

 {"error":{"message":"batch parameter must be a JSON array","type":"GraphBatchException"}} 

is the right way to check facebook api chart usage

+6
source share
2 answers

Simple code for checks. Try the following:

 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); 
+13
source

Probaly is a checkinData format. Try:

 String checkinData = "{"+ "\"message\":\"Test\"," + "\"place\":\"000000000\"," + "\"coordinates\":{\"latitude\":\"000000000\", \"longitude\":\"-000000000\"}\"" + "}"; 
+1
source

Source: https://habr.com/ru/post/905801/


All Articles