Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
590 views
in Technique[技术] by (71.8m points)

android - Using Temboo to perform a Facebook 'like' action

I would like to perform 'likes' in Facebook walls (from an Android app) using the Temboo Library, and I see there is a Choreo for this.

My problem is that the required parameters are the AccessToken (as usual), and an ObjectID, and I have no idea where can I get a proper ObjectID related for example to a Facebook Group Fan Page I would like to 'like'. How is the conversion from a certain URL to an ObjectID?

EDIT

I specify the following permissions: "email,publish_actions,user_likes", as stated in Facebook docs:

Note that the like action requires the existing user_likes Permission

I can post to the wall, but whenever I try to 'like' a web, for example: "https://www.facebook.com/pages/Guitar/113099055370169", I get:

com.temboo.core.TembooHttpException: {"output":{"Response":""},"truncatedItems":[],"execution":{"endtime":"1396561663481","id":"a5cfd72449539570145298fd4d668ba","lasterror":"A HTTP Error has occurred: The remote server responded with a status code of 403. Typically this indicates that access to the specified resource is forbidden. The data returned from the remote server was: {"error":{"message":"(#200) App does not have permission to make this call","type":"OAuthException","code":200}}.  The error occurred in the HTTPSend (Facebook) step.","starttime":"1396561663246","status":"ERROR","errortime":"1396561663445"}}

EDIT 18th June, 2014

Finally I retook the task to let my Android users like a Facebook page. I finally managed to do the WebView / web button trick, so they can tap on a web 'like' button and the like is properly performed. My problem comes when trying to check if the like action was OK. I am using the FQL choreo in two different ways, but both queries give empty results. My test Facebook user has definetely several likes performed, what am I missing?

My FQL queries using Temboo:

http://postimg.org/image/o22cxhxo9/

http://postimg.org/image/5xzccuzzt/

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use a different Choreo to return that value:

https://temboo.com/library/Library/Facebook/Searching/FQL/

Here's a screenshot that shows you how to use this Choreo to get the object ID for a URL.

And here are the inputs I used:

  • Access Token: yourOwnAccessToken
  • Conditions: url="http://mashable.com"
  • Fields: url, id, type, site
  • Table: object_url

Hopefully that solves your problem. Good luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...