facebook / facebook-android-sdk

Used to integrate Android apps with Facebook Platform.
https://developers.facebook.com/docs/android
Other
6.07k stars 3.64k forks source link

callback not called for GameRequest #1197

Open georgii11 opened 10 months ago

georgii11 commented 10 months ago

Checklist before submitting a bug report

Java version

8

Android version

31,33

Android SDK version

14.1.1

Installation platform & version

gradle

Package

Core & AppEvents

Goals

Use GameRequests to send invites to friends and receive a response of the request though the callback set.

Expected results

Have the callback set called when the request is finished

Actual results

The callback is not called, for neither successes, nor failure, nor cancel.

Steps to reproduce

It can be reproduced in the RPS Sample from the SDK repo by trying to challenge friends (to trigger a GameRequest dialog). It will be noticed that the logs from the callback don't get logged.

Code samples & details

gameRequestDialog = new GameRequestDialog(this);
    callbackManager = CallbackManager.Factory.create();
    gameRequestDialog.registerCallback(
        callbackManager,
        new FacebookCallback<GameRequestDialog.Result>() {
          @Override
          public void onCancel() {
            Log.d(TAG, "Canceled");
          }

          @Override
          public void onError(@NonNull FacebookException error) {
            Log.d(TAG, String.format("Error: %s", error.toString()));
          }

          @Override
          public void onSuccess(@NonNull GameRequestDialog.Result result) {
            Log.d(TAG, "Success!");
            }
          }
        });