lundi 7 avril 2014

Android : Obtenir l'identifiant facebook de comptes - Stack Overflow


I'm working on a app that collects data from the device accounts to automatically fill some fields. For example, I'm using:


AccountManager manager = AccountManager.get(this);
Account[]accounts = manager.getAccounts();
accounts = manager.getAccountsByType("com.twitter.android.auth.login");

to find out what Twitter account is logged in on the device and make a link to the user's profile.


The problem is that when I use:


accounts = manager.getAccountsByType("com.facebook.auth.login");

to get the Facebook account, I get an email address instead of the facebook id or username.


Is there a way of obtaining the facebook id/username once I have the email address? IMPORTANT: I know I can get these fields with the sdk but I don't want to. My app doesn't need the user to login with their facebook account because the app doesn't need any private info or does any facebook action. Making the user to login would be an unnecessary step. I am just looking to get the facebook id or username which are public.


Thanks



I'm working on a app that collects data from the device accounts to automatically fill some fields. For example, I'm using:


AccountManager manager = AccountManager.get(this);
Account[]accounts = manager.getAccounts();
accounts = manager.getAccountsByType("com.twitter.android.auth.login");

to find out what Twitter account is logged in on the device and make a link to the user's profile.


The problem is that when I use:


accounts = manager.getAccountsByType("com.facebook.auth.login");

to get the Facebook account, I get an email address instead of the facebook id or username.


Is there a way of obtaining the facebook id/username once I have the email address? IMPORTANT: I know I can get these fields with the sdk but I don't want to. My app doesn't need the user to login with their facebook account because the app doesn't need any private info or does any facebook action. Making the user to login would be an unnecessary step. I am just looking to get the facebook id or username which are public.


Thanks


0 commentaires:

Enregistrer un commentaire