facebook-android-sdk icon indicating copy to clipboard operation
facebook-android-sdk copied to clipboard

ShareDialog.canShow() == fasle although facebook is already installed

Open Aisheng opened this issue 2 years ago • 0 comments

Checklist before submitting a bug report

Java version

1.7

Android version

API 30, Android 11

Android SDK version

12.0.0

Installation platform & version

gradle: 3.3.3, Android Studio 4.0.1

Package

Share

Goals

I want to know if this is normal or abnormal, and if so, how to fix it

Expected results

If facebook is installed, then ShareDialog.canShow() should return true, and when I call ShareDialog.show() can normally jump to facebook to share the picture content

Actual results

If facebook is started, it can be shared normally, but if the process is actively exited by the user, ShareDialog.canShow() will return false and then you cannot jump to facebook to share.

Steps to reproduce

  1. start facebook
  2. exit it from the taskbar
  3. start game and click the share bottom,This step will call the ShareDialog.canShow() of the facebook SDK and return false.

Code samples & details

// INSERT YOUR CODE HERE
if (shareDialog.canShow(shareContent)) {
   shareDialog.registerCallback(mCallbackManager, facebookCallback);
   shareDialog.show(shareContent);
} else {
   Log.e(TAG, "share failed");
}

Aisheng avatar Mar 07 '23 03:03 Aisheng