facebook-android-sdk
facebook-android-sdk copied to clipboard
Sharing video as Story background is failing
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
All
Android SDK version
12.x.x, 13.x.x and earlier versions too
Installation platform & version
Gradle
Package
Share
Goals
We want to share videos to Facebook Stories. But, Facebook App is not shown up and return an error instead.
Expected results
Video should be passed to Facebook App's Story Screen
Actual results
Video is not passed to Facebook App's Story Screen. And show the following error is sent via FacebookCallback
.
Steps to reproduce
No response
Code samples & details
Share Video Code
// Model a video background asset
val video = ShareVideo.Builder().setLocalUrl(uri).build()
// Add to ShareStoryContent
val content = ShareStoryContent.Builder()
.setBackgroundAsset(video)
.build()
val shareDialog = ShareDialog(fragment).apply {
registerCallback(callbackManager, shareCallback)
}
dialog.show(content, ShareDialog.Mode.AUTOMATIC)
Callback Code [Error log will be attached below]
private val shareCallback = object : FacebookCallback<Sharer.Result> {
override fun onSuccess(result: Sharer.Result) {}
override fun onCancel() {}
override fun onError(error: FacebookException) {
// This error callback is invoked
Timber.e(error)
}
Error Log
I have met a similar error: "Parameter specified as non-null is null: method X.0zH.A1C, parameter param at index = 0" we can share video to facebook story about 4 month ago and we haven't made any change during these months. here's the code
val shareVideo = ShareVideo.Builder().setLocalUrl(videoUri).build()
val shareStoryContent = ShareStoryContent.Builder()
.setBackgroundAsset(shareVideo)
.build()
if (ShareDialog.canShow(ShareStoryContent::class.java)) {
shareDialog.show(shareStoryContent)
}
I have the same problem. Any solution?
I would recommend switching to the newer Share to Stories API https://developers.facebook.com/docs/sharing/sharing-to-stories/android-developers
Also see https://github.com/facebook/facebook-android-sdk/issues/1081 for an example of onboarding onto newer API
Me too. Has the problem been solved
I would recommend switching to the newer Share to Stories API https://developers.facebook.com/docs/sharing/sharing-to-stories/android-developers see https://github.com/facebook/facebook-android-sdk/issues/1081 for an example of onboarding onto newer API
Hi,
Full sample is here with new API: https://github.com/paulocoutinhox/android-share-story
Thanks.