Step 1: In-order to publish a place via checkin we are in need of the following parameters
1. Access Token
2. Place which is to be Checkin
3. Message which will display to your friends
4. Latitude and Longitude of that place
5. Tag i.e. User Id
Step 2: Use Bundle to wrap the above parameters
Bundle params = new Bundle();
params.putString("access_token", Main.access);
params.putString("place", "203682879660695");
params.putString("Message","I m here in this place");
JSONObject coordinates = new JSONObject();
coordinates.put("latitude", Main.mylat);
coordinates.put("longitude", Main.mylong);
params.putString("coordinates",coordinates.toString());
JSONArray frnd_data=new JSONArray();
params.putString("tags", "xxxx");//where xx indicates the User Id
Step 3: Call the Request method and check whether proper response you had got
String response = faceBook.request("me/checkins", params, "POST");
Log.d("Response",response);
Thanks Sankar..Really this snippet helped me a lot.
ReplyDeleteKeep posting.