2

I could check in with the older Facebook SDK used this code:

Facebook fb = new Facebook("APP ID");

Bundle params = new Bundle();
params.putString("access_token", "TOKEN");
params.putString("place", "PLACE ID");
params.putString("message","SOMETHING MESSAGE");

JSONObject coordinates = new JSONObject();
coordinates.put("latitude", "LATITUDE");
coordinates.put("longitude", "LONGITUDE");

params.putString("coordinates",coordinates.toString());
params.putString("tags", "USER ID");

String response = fb.request("me/checkins", params, "POST");

But the fb = new Facebook() and the fb.request() functions are deprecated in new 3.0 Facebook SDK! What can I replace them with? How can I check in with using the 3.0 Facebook SDK?

The Graph API need "publish_checkins" extended permission in Facebook app, but this permission is deprecated also.

Gerstmann
  • 5,368
  • 6
  • 37
  • 57

1 Answers1

1

You should use the static methods of the Request class to create requests and execute them. Looks like the most suitable method would be newStatusUpdateRequest that takes a GraphPlace as a parameter.

Alternatively, you can use the newPostRequest which allows you to construct a request that is much more similar to the way it was in previous SDK.

Muzikant
  • 8,070
  • 5
  • 54
  • 88