facebook-android-sdk
facebook-android-sdk copied to clipboard
Sharing a link to facebook doesn't work on certain devices
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing Github issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Java version
11
Android version
Android 9, Android 11
Android SDK version
11.3.0, 12.1.0, 12.2.0, 13.1.0
Installation platform & version
Gradle 7.1
Package
Share
Goals
The goal is that a user is able to share links to the facebook app.
Affected devices Xiaomi Mi A1 - Android 9.0 Samsung S21 Ultra - Android 11.0
Info
We noticed that in certain devices a user is not able to share a link to the facebook app with the android facebook sdk's ShareDialog.show(...)
. In most devices with the same exact code the result is successful.
We have verified the issue with both the production app and with a minimal sample app on the affected devices.
Stacktrace Application id has been redacted and replaced with "applicationid"
W/fb4a.BlueServiceQueue: Exception during service
X.2kq: [code] 100 [message]: Unsupported get request. Object with ID '<applicationid>' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api [extra]:
at X.1hl.A03(Unknown Source:78)
at X.1hl.A06(Unknown Source:13)
at X.1hl.A02(Unknown Source:20)
at X.1hl.A07(Unknown Source:24)
at X.3uj.A00(Unknown Source:4)
at X.3ua.handleResponse(Unknown Source:130)
at X.3Bf.A06(Unknown Source:14)
at X.3Ee.run(Unknown Source:52)
at X.14Q.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at X.14V.run(Unknown Source:3)
at X.14W.run(Unknown Source:14)
at java.lang.Thread.run(Thread.java:764)
Already reported issue The issue seems to be the same as https://github.com/facebookarchive/react-native-fbsdk/issues/828 from the react-native-fbsdk archive which has no resolution. When the user is logged out on the affected devices, the sharing functionality works. When the user is logged in, the sharing functionality doesn't work.
Expected results
When user clicks the "share on facebook" button, the facebook app successfully opens so that the user can share their link.
Actual results
When user clicks the "share on facebook" button, the facebook app does not open. There is a flickering of a window trying to open but is immediately shut down again.
Steps to reproduce
Prerequisites
- Use an affected device (Xiaomi Mi A1 - Android 9.0, Samsung S21 Ultra - Android 11.0)
- Have facebook app installed on the device and a user logged in
Steps
- Click a button that triggers sharing a link to the facebook app using ShareDialog.show(...)
Code samples & details
From the minimal sample app:
app build.gradle ----
implementation 'com.facebook.android:facebook-share:12.2.0'
Activity -----
binding.facebookButton.setOnClickListener {
FacebookSdk.setApplicationId("<valid id>")
FacebookSdk.setClientToken("<valid client token>")
FacebookSdk.sdkInitialize(this.applicationContext) // this is used for brevity but in the actual app the facebook sdk initialization is implicitly done through AndroidManifest
val content: ShareLinkContent = ShareLinkContent.Builder()
.setContentUrl(Uri.parse("http://www.google.com"))
.build()
ShareDialog.show(this, content)
}
Queries in AndroidManifest ----
<queries>
<package android:name="com.facebook.orca" />
<package android:name="com.facebook.katana" />
<package android:name="com.facebook.android" />
<provider android:authorities="com.facebook.katana.provider.PlatformProvider" />
<provider android:authorities="com.facebook.orca.provider.PlatformProvider" />
</queries>
This is a duplicate of https://github.com/facebook/facebook-android-sdk/issues/1028 which was closed as stale. However, the issue is persisting with later facebook sdk versions
Facebook is losing traffic due to this bug, is there any update?
I cannot reproduce this issue on my own test devices. Requesting one of the above mentioned.
Indeed, the issue is not happening for all devices but for the specific ones mentioned above
The issue is still happening on specific devices and facebook is losing traffic due to that, any updates?
Any updates on this issue?