nourelhoudabenahmed / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

FacebookJsonRestClient.stream_remove throw FacebookException: Permissions error when have "publish_stream" permission #260

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.String facebook_permissions = request.getParameter("permissions");
  Give: facebook_permissions: ["read_stream","offline_access","publish_stream"]

2.Object stream = ((IFacebookRestClient)userClient).stream_get(luid,
source_ids, start.getTime(), end.getTime(), 30, "", null);
  Get post from stream.

3.Object success =
((IFacebookRestClient)userClient).stream_remove(post.getString("post_id"),post.g
etLong("actor_id"));

com.google.code.facebookapi.FacebookException: Permissions error
    at com.google.code.facebookapi.JsonHelper.parseCallResult(JsonHelper.java:59)
    at
com.google.code.facebookapi.FacebookJsonRestClientBase.parseCallResult(FacebookJ
sonRestClientBase.java:51)
    at
com.google.code.facebookapi.FacebookJsonRestClient.stream_remove(FacebookJsonRes
tClient.java:58)
    at
com.google.code.facebookapi.FacebookJsonRestClient.stream_remove(FacebookJsonRes
tClient.java:3)

4. Object success =
((IFacebookRestClient)userClient).stream_removeComment(comment.getString("id"),c
omment.getLong("fromid"));
  removeComment also get same "Permissions error" FacebookException.

What is the expected output? What do you see instead?
expected: the comment or post gor deleted with no error.

What version of the product are you using? On what operating system?
facebook-java-api-3.0.1
Mac OS X 10.4.11

Please provide any additional information below.
Also tried users_hasAppPermission(Permission perm, Long userId) method to
check permission. i got a ClassCastException: Integer.

My permission from facebook API console:

<?xml version="1.0" encoding="UTF-8"?>

<fql_query_response xmlns="http://api.facebook.com/1.0/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true">

 <permissions>

   <uid>713633502</uid>

   <publish_stream>1</publish_stream>

   <read_stream>1</read_stream>

   <offline_access>1</offline_access>

 </permissions>

</fql_query_response>

Original issue reported on code.google.com by weihongz...@hotmail.com on 4 Nov 2009 at 8:41