In my Java app (still in early development and with only a couple of java classes) I need to access to my wall posts (at the end i'll have to access to my customer wall posts) and list them; in order to do it, i need the read_stream permission
I followed the full instructions of facebook developers site; I submitted my review; the final result was that FB developers denied te read_stream permission; they wrote me this alert:
General
Your app appears to be a test submission. If your app is still
in development, please wait to submit it for review until it has full
functionality.
The following items were not reviewed due to general
issues with your app: read_stream
How can I have the read_stream permission? Any tip is really appreciated
EDIT START
I'm using spring-social; in my java code, when I use the method: facebook.feedOperations().getFeed() I access to home posts and I have no problem at all; when I use facebook.feedOperations().getHomeFeed() I try to access to my wall posts and I got the exception I posted
My Java code:
#Override
public PagedList<Post> getPosts() throws Exception
{
try
{
Facebook facebook = new FacebookTemplate(this.facebookClientToken);
if( proxyEnabled )
{
if( requestFactory != null )
{
((FacebookTemplate)facebook).setRequestFactory(requestFactory);
}
else
{
throw new IllegalArgumentException("Impossibile settare la requestFactory; proxy abilitato ma requestFactory null");
}
}
PagedList<Post> result = facebook.feedOperations().getHomeFeed();
result.addAll(facebook.feedOperations().getFeed());
return result;
}
catch (Exception e)
{
String messagge = "Errore nel recupero feed: "+e.getMessage();
logger.fatal(messagge, e);
throw e;
}
}
My StackTrace:
09:35:31,939 WARN [RestTemplate] GET request for "https://graph.facebook.com/me/home?limit=25" resulted in 403 (Forbidden); invoking error handler
{"error":{"message":"(#200) Requires extended permission: read_stream","type":"OAuthException","code":200}}
09:35:31,971 ERROR [CoMiSocialNetworkSvcImpl] Errore nel recupero feed: The operation requires 'read_stream' permission.
org.springframework.social.InsufficientPermissionException: The operation requires 'read_stream' permission.
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:116)
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:65)
regards
Angelo
If your app needs read_stream permission then you can stop development now - FB will not give you that permission. Go to the following page to see why:
https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-user_posts
(search on "read_stream").
Related
our web application posts messages to Facebook wall of logged user. We are using the Facebook Graph API. This feature did work in the past. When trying it today, I am getting an error message and cannot figure out where the problem is.
I am testing it with my Facebook account and I did not reject any permission.
When the user wants to connect his / her FB account with our web app, the app redirects to
https://www.facebook.com/dialog/oauth/?client_id=our_ID&redirect_uri=our_URI&state=generated_string&scope=email,publish_actions&response_type=code
Later, when the app calls
https://graph.facebook.com/me/permissions?access_token=some_token
it receives response
{
"data":[
{
"permission":"email",
"status":"granted"
},
{
"permission":"public_profile",
"status":"granted"
},
{
"permission":"installed",
"status":"granted"
}
]
}
The permission publish_actions is missing.
When the app POSTs to
https://graph.facebook.com/me/feed?access_token=some_token
with parameter
message=somemessage
the following error response is returned
{
"error":
{
"message":"(#200) The user hasn't authorized the application to perform this action",
"type":"OAuthException",
"code":200,
"fbtrace_id":"FDM+n+5S14V"
}
}
Why is the permission to post on wall suddenly not granted?
Thanks for help.
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/"+MainActivity.ME_FBUSER_ID+"/events",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
Log.e("event",response.toString());
Toast.makeText(getActivity(), ""+response.toString(), Toast.LENGTH_SHORT).show();
}
}
).executeAsync();
returns
{Response: responseCode: 200, graphObject: {"data":[]}, error: null}
Have you set Permissions? That for you have to set user_events permission. At user login time. as like below
LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setFragment(this);
authButton.setReadPermissions(Arrays.asList("user_events", "friends_events"));
See below link for user permission:
https://developers.facebook.com/docs/facebook-login/android/permissions
https://developers.facebook.com/docs/facebook-login/permissions/#adding
You have to add permission after you can get it.
If you have done all above things and not work then you have to put app for review.
if you get Debug Message as like blow image in Graph API Explorer. You have to put app for review.
Documantation say To use the user_events permission you need to submit your app for review.
See below ScreenShot:
Your access token probably doesn't contain the user_events permission... Do you gather it during login?
See
https://developers.facebook.com/docs/facebook-login/permissions#reference-user_events
in our apps we have the option to share activity on Facebook after which the users get a small reward. In recent days this feature has stopped working for some of our users because we didn't get "post_id" from your side which we need to determine if the user should get a reward.
We found out that this happens when the user hasn't given us the "publish_actions" right. Therefore we have added a check for this right and we try to request it this way:
FB.api('/me/permissions/publish_actions', function(response) {
// pokud mame pravo na zverejneni obsahu hned postujeme
if (response.data && response.data[0] && response.data[0]['status'] === 'granted') {
postShareReport();
} else {
// pokud nemame, tak si zkusime vyzadat pravo
FB.login(function(response) {
if (response.authResponse) {
// pokud nam ho dal, tak postujeme
if(response.authResponse.grantedScopes && response.authResponse.grantedScopes.indexOf('publish_actions') !== -1) {
postShareReport();
}
}
}, {scope: "email,publish_actions",return_scopes: true, auth_type: 'rerequest'});
}
});
However, here we encountered another problem. The publish_actions right is not requested from some users even though they haven't given us this right. The login process does go through, however. The user doesn't receive the window with the option to give us this right.
Thank you
Kind regards
Most permissions need to get reviewed by Facebook: https://developers.facebook.com/docs/facebook-login/review
Without review, publish_actions only works for users with a role in the App. Ohter users don´t get asked for the permission in the authorization process.
Btw, not getting a Post ID or information if the user really shared something is intentional, because rewarding the user in any way for sharing is not allowed. You need to read the platform policy before creating any App, that rule is in there since years:
Only incentivize a person to log into your app, enter a promotion on
your app’s Page, or check-in at a place. Don’t incentivize other
actions.
Source: https://developers.facebook.com/policy/
I have an iFrame Facebook application. I am using the Facebook C# SDK (version 6.0.10.0), Facebook and Facebook.Web (version 5.4.1.0') libraries.
As i get some help from stackoverflow and some other sites
Facebook C# SDK Authorization Problem
http://forum.ngnrs.com/index.php/topic,199.0.html
i coded as
protected void Page_Load(object sender, EventArgs e)
{
fbApp = new FacebookApp();
authorizer = new CanvasAuthorizer(fbApp);
authorizer.Perms = requiredAppPermissions;
if (authorizer.Authorize())
{
//user authorized
}
else
{
//user not authorized
}
}
but in the line "authorizer = new CanvasAuthorizer(fbApp);" it gives ma a syntax error
as Error 14 The best overloaded method match for 'Facebook.Web.CanvasAuthorizer.CanvasAuthorizer(Facebook.Web.FacebookWebContext)' has some invalid arguments.
In Facebook C# SDK there is no clue about the syntax change;
Please help ?
For a Canvas app, Facebook does a post request to your Canvas Url that you specified in your Application settings. In the post request, you get the signed_request parameter. All you have to do is parse that parameter using the Facebook API method and it will give you the access token which is used to make further calls.
Here is a brief tutorial about the same. This was written with ASP.NET MVC 3.0 in mind. However you can use most of the code for classic ASP.NET too.
http://theocdcoder.com/tutorialcreate-a-facebook-canvas-app-using-asp-net-mvc-3/
I'm running into a strange bug...
I'm asking for publish_actions permissions (I want to publish on the user's timeline the dive he just logged on diveboard.com ), and since I may want this to work in bulk (like publish all my dives) i want it done in the back and not through the front. I still want to request the permission on the front interactively.
When I ask only for "publish_actions", the popup opens and closes immediately and obviously the permission was not granted (checked in privacy)
FB.login(function(response) {
if (response.perms != undefined && response.perms.match(/publish\_actions/)!=null) {
G_user_fbtoken = getFBCookie().accessToken;
fbtimelinepublish_dive();
} else {
// user cancelled login
diveboard.notify("Unsufficient privileges","Could not get the adequate permissions to publish this action on your timeline");
toggle_fb_spinner();
return;
}
}, {scope:'publish_actions'});
}else{
fbtimelinepublish_dive();
}
Any clue !?
update : I tried with : scope:'create_event,publish_actions,publish_stream,rsvp_event'
and got
So I'm self-answering a solution : While in Open Graph Beta, the 'publish_actions' permission can only be requested from developers and test users of your app. The 'publish_actions' permission will be ignored if requested from any other user. and I moved to the new auth window.... hopefully this will save some frustrations to others....