Open GoogleCodeExporter opened 8 years ago
I'd like to submit a patch for consideration. This is an implementation of
Facebook's newish links_post() method for posting a link on behalf of a user. I
believe I have followed the coding standards of the project. I did not include
modification to the schema b/c I'm not totally clear on the procedure for doing
that/generating the diff, but it's a very straight-forward change: just adding a
simple result type.
Let me know what you think. If this looks good to you, I'd like to tackle some
of
the other unimplemented API methods.
Original comment by o.nl...@gmail.com
on 5 Mar 2009 at 11:38
Attachments:
Oh, BTW, I am the original submitter for this issue. The MyRockstar.com
address is
my work email. :P
- nate
Original comment by o.nl...@gmail.com
on 5 Mar 2009 at 11:40
Hi. Don't worry too much about the diff file. I've posted a link that makes it
pretty
easy to see the differences here:
http://code.google.com/p/facebook-java-api/wiki/XSDSchemas
I've committed your changes. I've also committed a JUnit test which it would be
great
if you could expand on as you think appropriate.
It's called Issue175LinksPosting.java and please note that *the @Ignore flag is
set*
on this JUnit test. The reason for that is the test fails with an error:
Managing shared items requires the extended permission share_item
So, perhaps you can see whether this JUnit works for you and provide another
patch
with updates as required. It would be good if you also implemented the get links
method so that we could have a decent JUnit test of posting a link then
checking with
the get() method that it successfully got added to the profile?
Thanks.
Original comment by david.j....@googlemail.com
on 7 Mar 2009 at 2:51
I see that this feature has been added to the 2.1.0 release, but it seems that
the
schema hasn't been updated accordingly yet - I get an UnmarshalException due to
an
unexpected element (links_post_response). When I added the elements
links_post_response and link_id to the schema and rebuilt the project, the
method
call worked. So an update of the schema to the latest version would be very much
appreciated.
/Tobias
Original comment by tobias.l...@gmail.com
on 13 Mar 2009 at 8:57
Tobias: Yes, I did not update the schema to reflect the new return type because
I was
unsure about the process. I believe this patch should solve the problem:
### Eclipse Workspace Patch 1.0
#P facebook-api
Index: facebook-java-api-schema/src/main/resources/schema.xsd
===================================================================
--- facebook-java-api-schema/src/main/resources/schema.xsd (revision 665)
+++ facebook-java-api-schema/src/main/resources/schema.xsd (working copy)
@@ -43,6 +43,11 @@
<xsd:restriction base="xsd:long" />
</xsd:simpleType>
+<!-- Link ID type -->
+<xsd:simpleType name="lnid">
+ <xsd:restriction base="xsd:long" />
+</xsd:simpleType>
+
<xsd:simpleType name="page_id">
<xsd:restriction base="xsd:long" />
</xsd:simpleType>
@@ -1259,6 +1264,8 @@
<xsd:element name="marketplace_removeListing_response" type="xsd:boolean" />
+<xsd:element name="links_post_response" type="lnid" />
+
<xsd:element name="liveMessage_send_response" type="xsd:boolean" />
<xsd:element name="notifications_get_response" type="notifications" />
Original comment by o.nl...@gmail.com
on 13 Mar 2009 at 6:42
David:
Awesome, thanks for committing my code. The test looks good, minus the check
that
the link was actually posted. However, a non-zero ID returned by the call is
probably sufficient since it indicates that FB at least thinks the call
succeeded.
This API method requires an additional privilege (share_item) be approved by
the user
for the app. It passes for me because my test user has added this privilege
for my
test app. I'm not sure what you would want in terms of creating a JUnit test
that
will reliably pass for people, beyond requiring that this privilege be enabled
-- an
added element of confusion.
Would it be possible to create a dedicated test app and publish its keys so that
tests always run against a known configuration for all developers?
Cheers,
nate
Original comment by o.nl...@gmail.com
on 13 Mar 2009 at 6:52
I agree, I think that having a dedicated test API account (in fact, a few of
them) is
becoming necessary. Would you like to create a couple (suggest a naming
convention to
indicate that they're linked to the facebook-java-api and its specific purpose)?
Then, if you post the API_KEY, SECRET, Email and Password here we can start
building
JUnit tests around them.
Original comment by david.j....@googlemail.com
on 21 Mar 2009 at 8:47
Issue182 has updated schema.xsd and has incorporated your changes. Will be
available
in 2.1.1.
Original comment by david.j....@googlemail.com
on 21 Mar 2009 at 8:52
Any estimate on when 2.1.1 will be available? I would really like to be able to
use
these new features in an official release quite soon. :)
Cheers,
Tobias
Original comment by tobias.l...@gmail.com
on 8 Apr 2009 at 7:11
Working on a release over the next couple of days. There's a problem with some
of the
classes generated from the xsd schema. Unfortunately, moving from
<element><complexType>... to <element type="mytype"> <complexType name="mytype"
introduces horrid JAXBElement wrappers. I'm going to need to work around this
before
proceeding with the release.
Original comment by david.j....@googlemail.com
on 9 Apr 2009 at 1:41
Hi i'm trying to use links_post method from an application to my profile, but
allways i get "FacebookException: Managing shared items requires the extended
permission share_item" .
I have edited too, application config in my profile and ensure that "share items"
is checked in extended permission of that application.... No idea more... I
have
tryed too make login fist time adding to url the querystring "?
ext_perm=share_item" Any idea ? Thank u,
Original comment by iker.ola...@gmail.com
on 1 Aug 2009 at 11:52
[deleted comment]
I'm having the same problem using links_post -- no matter what I do it will not
post
to the Wall on my Page and the page does have the application installed it does
have
checked ability to enable postings from application, and I do have share_item
extended permissions. Unless I'm missing something to enable this on page
level.
Original comment by mikep...@gmail.com
on 8 Sep 2009 at 8:20
I'm having the same problem; unfortunately, I filed a bug report on this (#293;
please
close as "duplicate") without first checking that the bug had already been
reported.
Original comment by ruom...@gmail.com
on 10 Feb 2010 at 6:25
Any idea when this will be fixed? We're dying here! It's critical that apps be
able to
post to the user's wall.
Original comment by ruom...@gmail.com
on 18 Feb 2010 at 6:28
Still no response. Would someone please bump this up to "critical".
Original comment by ruom...@gmail.com
on 25 Feb 2010 at 7:37
My mistake: links_post() works fine, as long as extended permissions are
requested
correctly. I just got it working minutes ago.
Original comment by ruom...@gmail.com
on 26 Feb 2010 at 3:50
Original issue reported on code.google.com by
naters...@gmail.com
on 4 Mar 2009 at 12:29