I have two different facebook applications. One is used for authorizing on android and one on the web. I have an api for android app to save all users on server. The problem is that android app doesn't send a real user id. When the same user logs in from the web I get the correct id but that's completely different what android returns for the same user. Now the same users are recorded as two different users because they have different ids.
This is how I get user id on android:
mAsyncRunner.request("me", new BaseRequestListener() {
@SuppressLint("CommitPrefEdits")
@Override
public void onComplete(String response, Object state) {
String json = response;
try {
JSONObject profile = new JSONObject(json);
facebook_id = profile.getString("id");
GlobalClasses.Facebook_id = facebook_id;
facebook_user_name = profile.getString("name");
SendFacebookIdToServer();
editor.putString("facebook_user_name", facebook_user_name);
editor.putString("facebook_user_id", facebook_id);
editor.commit();
Intent i = new Intent(getApplicationContext(),
ChooseChempions.class);
startActivity(i);
overridePendingTransition(R.anim.trans_left_in,
R.anim.trans_left_out);
} catch (JSONException e) {
e.printStackTrace();
}
Has anyone ever faced the same problem?