Reputation: 11308
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?
Upvotes: 0
Views: 206
Reputation: 31479
I guess one of your apps is created before April 30th 2014, and one after. For the newer one, you'll receive so-called app-scoped user_ids. See my answer here: Weird Facebook ids
Why do you use two different apps? I think it should be feasible with only one as well.
Upvotes: 1