samedi 9 mai 2015

Facebook get JSON datas android

i'm using this method directly from Facebook Developer to get users information after login, i need to get username, userid and email

public void onSuccess(LoginResult loginResult) {
                GraphRequest request = GraphRequest.newMeRequest(
                        loginResult.getAccessToken(),
                        new GraphRequest.GraphJSONObjectCallback() {
                            @Override
                            public void onCompleted(
                                    JSONObject object,
                                    GraphResponse response) {
                                // Application code


                            }
                        });
                Bundle parameters = new Bundle();
                parameters.putString("fields", "id,name,email");
                request.setParameters(parameters);
                request.executeAsync();

how should i do to get the JSON information and store it in Public variable in my document, to use it in other function ?

Aucun commentaire:

Enregistrer un commentaire