iOS Swift中Facebook直播发布问题:登录后无法推流及权限报错求助
Let’s break down exactly what’s going wrong here and how to get your live streaming working properly:
- The core issue: The
public_actionspermission was deprecated and fully removed by Facebook years ago—it’s no longer a valid scope, which is why you’re seeing that error on your iPad (this would likely pop up on other devices too, even if it’s only visible to you there right now).
To resolve this and enable live stream publishing, follow these steps:
Swap the invalid scope for the correct one
For Facebook Live video publishing, the official, supported permission ispublish_video. This is the scope you need to request instead of the outdatedpublic_actions.Update your login permission request code
Locate where you’re initiating the Facebook login flow in your app and replace the old scope withpublish_video. Here’s a quick example using the Facebook iOS SDK:// Before (invalid) loginManager.logIn(permissions: ["public_actions"], viewController: self) // After (correct) loginManager.logIn(permissions: ["publish_video"], viewController: self)Check your Facebook Developer Dashboard settings
- Navigate to your app’s page in the Facebook Developer Dashboard, go to the "App Review" section, and ensure
publish_videois added to your requested permissions. - If your app is public (available to users outside your test accounts), you’ll need to submit the
publish_videopermission for Facebook’s app review and get it approved before regular users can use the live streaming feature. Test accounts can use it without approval during development.
- Navigate to your app’s page in the Facebook Developer Dashboard, go to the "App Review" section, and ensure
Validate permissions after login
After a user completes the login flow, confirm that they’ve granted thepublish_videopermission before attempting to start a live stream. You can fetch the list of granted permissions via the Facebook SDK to avoid unexpected failures.
Once you make these changes, the "Invalid Scopes" error should disappear, and you’ll be able to successfully publish live streams to Facebook from your iPad.
内容的提问来源于stack exchange,提问作者PvDev

