Domanda

I have an app, which users will login via facebook to use this app. Now what i'm need is i want to get that logged user's facebook url which comes like

"http://www.facebook.com/person.name"

Now, I want to get this url or I need "person.name" through my app. I can get Facebook name (Person Name) but i don't know how to get that userName. Please any help appreciated.

È stato utile?

Soluzione

First, provided that you have logged in, you may send a request to get your profile using:

AsyncFacebookRunner asyncFacebookRunner = new AsyncFacebookRunner(facebook); asyncFacebookRunner.request("me", new fbRequestListener());

Then on the listener, you can get username field on the response.

public class fbRequestListener implements RequestListener() {

@Override
public void onComplete(String response, Object state) {
     /**Parse the json response here to get the username
      Then, append it to the url as "http://www.facebook.com/" +username*/

}

/**don't forget to override other methods*/

}

Hope that helps. :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top