How can I programmatically check in using android application like foresquare ? question describes it well I am not sure if it is supported by facebook API
Asked
Active
Viewed 1,039 times
0
-
1Are you trying to do this: http://stackoverflow.com/questions/10860067/facebook-check-in-api – Aamir Abro Oct 16 '14 at 07:07
-
Yes, you can do this programatically, ofcourse – Pratik Dasa Oct 16 '14 at 07:17
-
Thank you for your responses, I will try it out and get back to you – user3833308 Oct 16 '14 at 17:06
1 Answers
1
Try with below method:
private ArrayList<String> permissions = new ArrayList<String>();
permissions.addAll(Arrays.asList("photo_upload","publish_checkins","publish_actions"));
Session session = openActiveSession(YOUR ACTIVITY NAME.this, true, new Session.StatusCallback() {
@SuppressLint("UseValueOf")
@Override
public void call(Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
try {
if (getCurrentLocation() != null) {
location.put("latitude", new Double(YOUR LATITUDE));
location.put("longitude", new Double(YOUR LONGITUDE));
} else {
Toast.makeText(YOUR ACTIVITY NAME.this, getString(R.string.facebook_location_not_found), Toast.LENGTH_LONG).show();
return;
}
} catch (Exception e) {
e.printStackTrace();
}
Bundle params = new Bundle();
params.putString("place", id);
params.putString("coordinates", location.toString());
if (edtMessage.getText().toString().trim().length() > 0) {
params.putString("message", message);
}
Request.Callback callback = new Request.Callback() {
@Override
public void onCompleted(Response response) {
Toast.makeText(YOUR ACTIVITY.this,"Checkins success, Toast.LENGTH_LONG).show();
}
};
Request request = new Request(session, "me/checkins", params, HttpMethod.POST, callback);
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
}
}
}, permissions);

Pratik Dasa
- 7,439
- 4
- 30
- 44
-
Thank you for your responses, I will try it out and get back to you – user3833308 Oct 16 '14 at 17:06