Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot share video asset to Facebook Story #2489

Open
5 tasks done
vfa-nhanbt opened this issue Oct 11, 2024 · 0 comments
Open
5 tasks done

Cannot share video asset to Facebook Story #2489

vfa-nhanbt opened this issue Oct 11, 2024 · 0 comments

Comments

@vfa-nhanbt
Copy link

vfa-nhanbt commented Oct 11, 2024

Checklist before submitting a bug report

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: <NSError: 0x3005396e0; domain: FBSSceneSnapshotErrorDomain; code: 2; "the request was denied"> { 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

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"] = "<my-facebook-app-id>"
            }
            UIPasteboard.general.setItems([pasteboardItems], options: pasteboardOptions)

            let urlString = "\(stories)://share?source_application=<my-facebook-app-id>"
            let urlScheme = URL(string: urlString)
            UIApplication.shared.open(urlScheme!, options: [:]) { success in
                if success {
                    print("[DEBUGGING] sharing success")
                } else {
                    print("[DEBUGGING] sharing failure")
                }
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant