facebook / facebook/facebook-ios-sdk

Cannot share video asset to Facebook Story

Open
#2,489 0 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Swift
Stars
8.1k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### 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](https://github.com/facebook/facebook-ios-sdk/issues)
- [X] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [X] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [X] This issue is not security related and can safely be disclosed publicly on GitHub

### Xcode version

15.4

### Facebook iOS SDK version

17.3.0

### Dependency Manager

CocoaPods

### SDK Framework

Share

### Goals

Check the root cause of this error.

### Expected results

I want the video to be fully shared from the app to Facebook Story.

### Actual results

- The app switches to Facebook and flashes one frame of my video, then jumps back to my app. When I go back, Facebook displays normally (not on the edit story screen as expected).
- Xcode console noti a message like this:
`Snapshot request 0x300496a30 complete with error: {
NSLocalizedDescription = an error occurred during a scene snapshotting operation;
}`
- The issue was tested on 3 devices and it was found that, as of now, it only occurs on iOS 16.5 and 17.3.1, while iOS 15.2.1 runs normally.
- My video information:
`Resolution: 1080x1920
Length: 0:18s
Size: 7,2 MB`

### Steps to reproduce

_No response_

### Code samples & details

```swift
if #available(iOS 10.0, *) {
let pasteboardOptions: [UIPasteboard.OptionsKey: Any] = [:]
let backgroundVideo = try? Data(contentsOf: URL(fileURLWithPath: videoFile))
var pasteboardItems = [String: Any]()
if let videoBackgroundShare = backgroundVideo {
pasteboardItems["com.facebook.sharedSticker.backgroundVideo"] = videoBackgroundShare
pasteboardItems["com.facebook.sharedSticker.appID"] = ""
}
UIPasteboard.general.setItems([pasteboardItems], options: pasteboardOptions)

let urlString = "\(stories)://share?source_application="
let urlScheme = URL(string: urlString)
UIApplication.shared.open(urlScheme!, options: [:]) { success in
if success {
print("[DEBUGGING] sharing success")
} else {
print("[DEBUGGING] sharing failure")
}
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.