2013-02-14 5 views
0
내가 안드로이드를 사용하여 페이스 북에 chekin하려면 다음 코드를 사용하고

:페이스 북 체크인 오류

private void checkin(){ 
    String access_token = mPrefs.getString("access_token", null); 
    Bundle params = new Bundle(); 
    params.putString("access_token", access_token); 
    JSONObject place = new JSONObject(); 
    try { 
     place.put("location", location.toString()); 
     place.put("name", name); 
     place.put("id", id); 
    } catch (JSONException e1) { 
     // TODO Auto-generated catch block 
     e1.printStackTrace(); 
    } 
    Log.i("place", place.toString()); 
    params.putString("place", place.toString()); // YOUR PLACE ID 
    params.putString("message","I m here in this place"); 
    JSONObject coordinates = new JSONObject(); 
    try { 
     coordinates.put("latitude", Latitude); 
     coordinates.put("longitude", Longitude); 
    } catch (JSONException e) { 
     e.printStackTrace(); 
    } 

    params.putString("coordinates",coordinates.toString()); 
    params.putString("tags", "xxxx");//where xx indicates the User Id 
    String response=""; 
    try { 
     response = facebook.request("me/checkins", params, "POST"); 
    } catch (FileNotFoundException e) { 
     e.printStackTrace(); 
    } catch (MalformedURLException e) { 
     e.printStackTrace(); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } 
    Log.d("Response",response); 
} 

하지만 체크인하는 동안 난 ::

{"error":{"message":"(#114) An id must be a valid ID string (e.g., \"123\")","type":"OAuthException","code":114}} 

같은 오류를이 난 곳을 얼마나되고 무엇입니까 페이지 URL이 내 FB 페이지 인 세부 정보 URL :

try { 
     String response = facebook.request(pageURL); 
     Log.i("Facebook Page Response ", response); 
     JSONObject jobj = new JSONObject(response); 
     location = new JSONObject(jobj.getString("location")); 
     Latitude = location.getString("latitude"); 
     Longitude = location.getString("longitude"); 
     id = jobj.getString("id"); 
     name = jobj.getString("name"); 
     Log.i("Latitude", location.getString("latitude")); 
     Log.i("Longitude", location.getString("longitude")); 
     Log.i("id", jobj.getString("id")); 
    } catch (MalformedURLException e) { 
     e.printStackTrace(); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } catch (JSONException e) { 
     e.printStackTrace(); 
    } 

나는 Facebook API를 사용하는 데있어 매우 새로운 도움을받습니다.

답변

0

죄송합니다. 나는이 방법을 사용하기에 너무 바보입니다. Facebook 문서에 따라 사용되지 않습니다. 이 게시물을 삭제할 수 없습니다. 죄송합니다.