What permission to use when sharing on Facebook using Unity - facebook

I share screenshots on Facebook from my android app (developed on Unity)
and it used to work perfect, but I guess Facebook changed their policy and I have no Idea what permissions I need to use in order to continue sharing a texture on Facebook.
That's how I log in:
var permissions = new List<string>() {"publish_actions"};
FB.LogInWithPublishPermissions(permissions);
By using CurrentAccessToken.Permissions I receive on debugger: Permissions: public_profile (which means the user didn't get the publish_actions permission).
And when I try to share the pic on Facebook by-
FB.API("me/photos", HttpMethod.POST, APICallback, wwwForm);
I receive 403 forbidden.
I read that publish_actions got removed, so how can I share a screenshot now?

Yeah there is no need for publishing permission anymore. How about trying
FB.ShareLink. this is what I use now. Facebook has a new way of sharing you can't do it frictionless anymore. With this, a popup keeps appearing related to posting.
https://developers.facebook.com/docs/unity/reference/current/FB.ShareLink

Related

Not able to post to Facebook using custom-ui project of socialauth-android project

I am not able to post Facebook using the custom-ui project of socialauth-android.
Here is the error log.
10-31 13:18:05.124: D/SocialAuthError(21880): org.brickred.socialauth.exception.SocialAuthException: org.brickred.socialauth.exception.SocialAuthException: Status not updated. Return Status code :403
10-31 13:18:05.124: W/System.err(21880): org.brickred.socialauth.android.SocialAuthError: Message Not Posted
10-31 13:18:05.124: W/System.err(21880): at org.brickred.socialauth.android.SocialAuthAdapter$6.run(SocialAuthAdapter.java:868)
10-31 13:18:05.124: W/System.err(21880): at java.lang.Thread.run(Thread.java:818)
I am not able to find the issue. I am using the same API keys got from the Github source.
You are getting 403 Authentication Error that clearly means that your app is presently not authorized to publish on Facebook profile of the user.
There is some problem the way you are trying to use Facebook APIs. I would suggest you to the latest Facebook SDK for Android as some of the older methods may be deprecated. Let me tell you the approach for doing this right way. (I recently implemented latest Facebook SDK)
You need a permission
There are some specific permissions that you require to do some specific operations with Facebook SDK. For example, You need publish_actions permission if you want your app to post status on user's profile.
Check Out It says,
For example, the publish_actions permission lets you post to a person's Facebook Timeline.
How to get Permissions
You need to show the user a login button which will ask him to do login with his facebook account and notifying the user what your app may do with his Facebook profile. It will show the permissions. In your case you need to add a login button with publish_actions permission. Once the user accepts it, your app becomes authorized to post status.
Complete Tutorial is here for doing the login process of Facebook with permissions.
You will need to do the following,
LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setFragment(this);
authButton.setReadPermissions(Arrays.asList("user_likes", "user_status", "publish_actions"));
return view;
So you can see we are asking the user to give you the publish_actions permission. It is not mandatory to include user_likes or user_status permissions. You can remove them if you don't need them.
Next what after login
After the user logs in, you get an authentication token in your session with Facebook. So now you can use that to publish on user's profile.
How to post
Now there are many ways to publish posts or status on Facebook. The first one I would like to discuss is using the Graph API
Here is somewhat code, you can use to publish to facebook.
Session session = Session.getActiveSession();
new Request(
session,
"/me/feed",
null,
HttpMethod.POST,
new Request.Callback() {
public void onCompleted(Response response) {
}
}
).executeAsync();
NOTE
You do also need to create developer account with facebook and add your app to its dashboard, generate an app_id and mention the same in your AndroidManifest.xml file.

submitting facebook app for permission of publish_actions

For using score api as it is mentioned it is require to take publish_actions permission as mentioned here https://developers.facebook.com/docs/games/scores/
when I tried to add permission to my app it is giving error It looks like you haven't made any API requests to access content with the publish_actions permission in the last 30 days.
I am making call
FB.API("/me/scores", Facebook.HttpMethod.POST, PostCallBack, scoreData); in game (which is not working)
note that I am doing re-submission. any solution how can I submit facebook app for review for permission of publish_actions
Check List for you.
Your Facebook Sdk integrate properly end?. Document
Available to the general public. Facebook dev page -> apps -> status&review -> switch your app status
If your used to Facebook SDK for Unity , open InteractiveConsole scene checks work It.
Good luck :D
We had the same issue and is fixed now. THe one and only thing you have to do is to login to facebook (inside your application, once the login action is called) with your admin username and password (not with your personal username) atleast once.
If both are the same then i dont think this issue will arise.
Let me know if this worked. THanks

new app-id - OAuthException (#200) on post comment

Since I created a new (Facebook) App last week, I get an OAuthException whenever I want to comment on a post.
"(OAuthException) (#200) You do not have sufficient to permissions to perform this action".
With the old App, my application works fine.
Now I found out that Facebook has changed the login policy recently. I also found the following remark on https://developers.facebook.com/docs/facebook-login/permissions/v2.0:
"If your app asks for more than than public_profile, email and user_friends it will require review by Facebook before your app can be used by people other than the app's developers".
So if I post with the same account with which I created the App, it should work, right? Only it doesn't...
Remark: if I use the new App with another Facebook-account, I have even less permissions (e.g. cannot access the account's pages). So I have more permissions if I use the same account, but still I cannot post!
I use Graph API via .NET Facebook-Client; my App is a native app (desktop app).
Could someone please tell me how to post with a new App? This is the main use-case of our application! Thank you very much!
Here is a screenshot of what I see instead of the login-screen when I use extended permission "publish_action" instead of "publish_stream"
You must be able to post with your own account since you are the admin of the application. - since only the admins/developers/testers will be able to test the app with the publishing functionality before it gets approved by facebook.
If you still are not able to, you must have not granted the permissions to the app. Things to check-
You are using publish_actions and not publish_stream
Check in your application settings whether or not you can see the publishing permission is granted for that app.
If not granted, go through the login process again and grant the publishing permission (may be by removing the app from settings and then authorizing again OR logout the app and then login again with publish_actions)
Problem solved - it was a stupid typo: I wrote publish_action instead of publish_actions (should be plural)! Thanks again to CBroe who pointed it out in this thread!

Using an app access token, why do i need publish_stream permission instead of just publish_actions

I'm using an app access token to write to a facebook user's wall (using the facebook graph toolkit in asp.net). i've found that the process works fine if i have publish_stream permission but fails if i only have publish_actions. i would prefer to work only with publish_actions to avoid the second screen permission request.
this issue seems to go against the fb docs which state "Moving forward, we recommend that apps only ask for publish_actions, as this permission encompasses the other two and we want to simplify the model." (https://developers.facebook.com/docs/concepts/login/permissions-login-dialog/)
I'm wondering if anyone else has experienced and overcome this issue.
You need to check out this.
It says-
publish_actions will now include basic publish_stream permissions (including posting on a user's timeline, posting photos/videos, commenting on and liking content), which will appear on the first Auth Dialog screen. With this change, apps that were previously granted publish_stream do not need to request publish_actions.
as you said, BUT-
If you need specific capabilities like posting to a friend's timeline or to groups, you will still need to request publish_stream, which appears on a second screen where users can also opt out.

Actionscript Graph API: Requesting publish_stream extended permission WHEN USER ALREADY LOGGED IN

How do I in the latest Actionscript Graph API,
force user to allow publish_stream
When : We are doing a facebook timeline app and I need to be able to post an application link
But: The User does not login via app but via site directly so I can NOT do
Facebook.login(handleLogin,["publish_stream]);
-- Nothing happens as we are already logged in
i dont know if you got this error just on copy and paste here, but...
you try this:
Facebook.login(handleLogin,["publish_stream"]);
instead this:
Facebook.login(handleLogin,["publish_stream]);
cya,
have a nice coding