create facebook-game-groups returns empty dialog

69 Views Asked by At

I'm adding facebook game groups to an Android app and trying to create a facebook game group using Dialog as appears in the documentation - https://developers.facebook.com/docs/games/app-game-groups/v2.1

Bundle params = new Bundle();
params.putString("name", "A test group");
params.putString("description", "A description for my group.");
params.putString("privacy", "open");

WebDialog feedDialog = (
        new WebDialog.Builder(getActivity(),
                Session.getActiveSession(),
                "game_group_create",
                params))
                .setOnCompleteListener(new OnCompleteListener() {
                    @Override
                    public void onComplete(Bundle values,
                                           FacebookException error) {
                        if (error != null && 
                                (error instanceof FacebookOperationCanceledException ||
                                        error instanceof FacebookServiceException)) {
                            Log.d(TAG, "User canceled by closing dialog or canceling.");
                        } else {
                            // success
                            Log.d(TAG, "group created: " + values.toString());                                          
                        }                                       
                    }
                })
                .build();
                feedDialog.show();

The Dialog appears empty without any content just white window with close button "x"

Any idea?

1

There are 1 best solutions below

0
On

The access_token used to create game group must be app_access_token in the format of {app_id}|{app_secret}.


And more importantly, this request must be called from server side to avoid app token being leaked.


I also don't know how to generate App Access Token from Java client.