{"error":{"message":"(#100) No permission to publish the video","type":"OAuthException","code":100,"fbtrace_id":"AWUNTlXGLLhiNtgEqnf26Gp"}}
Steps to Reproduce
Initialize Facebook SDK
Log in with publish_video permission (either LogInWithReadPermissions or LogInWithPublishPermissions)
Use FB.API to post to /me/videos
Code Samples & Details
Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.
Note: Remember to format your code for readability:
private static void Init(Action<bool> callback) {
FB.Init(() => {
if (FB.IsInitialized) {
Debug.Log("Initialized Facebook SDK");
} else {
Debug.LogError("Failed to initialize Facebook SDK");
}
callback(FB.IsInitialized);
});
}
public static void Login(Action<bool> callback) {
if (!FB.IsInitialized) {
Init(success => {
if (success) Login(callback);
});
} else {
FB.LogInWithPublishPermissions(new List<string>() { "public_profile", "email", "user_friends", "publish_video" }, result => {
if (result == null) {
Debug.LogError("Null result");
callback(false);
} else if (result.Cancelled) {
Debug.LogError("Cancelled");
callback(false);
} else if (string.IsNullOrEmpty(result.RawResult)) {
Debug.LogError("Empty result");
callback(false);
} else {
Debug.Log("Result: " + result.RawResult); // TODO: can we extract useful info from this?
callback(true);
}
});
}
}
public static void PostGIF(byte[] gif) {
if (!FB.IsInitialized) {
Init(success => {
if (success) PostGIF(gif);
});
} else if (!FB.IsLoggedIn) {
Login(success => {
if (success) PostGIF(gif);
});
} else {
// start upload
WWWForm form = new WWWForm();
form.AddField("upload_phase", "start");
form.AddField("file_size", gif.Length.ToString());
FB.API("me/videos", FacebookSDK.HttpMethod.POST, result => {
Debug.Log(result.RawResult);
}, form);
}
}
Checklist
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
2019.3.0f3
7.19.0
iOS
version13.3
Goals
After logging in with the
publish_video
permission, upload a video to/me/videos
Expected Results
Successful video upload
Actual Results
The login is successful:
But the upload is not:
Steps to Reproduce
publish_video
permission (eitherLogInWithReadPermissions
orLogInWithPublishPermissions
)FB.API
to post to/me/videos
Code Samples & Details
Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.
Note: Remember to format your code for readability: