I have created custom action and custom object types.
I create custom object instance using Facebook Open Graph Object API
I get the id of the object and use the id to post the story.
In the timeline, I see 2 posts:
"User" posted "custom object title" via "app name"
Story that I explicitly published.
Why is (1) getting created? Is it possible to avoid (1) in some manner?
Thanks
Check out How Open Graph Works. They are tied up to an action and that is why (1) is created. If you only want to publish the story, I would suggest using a "status update" on Facebook. Also, take a look at Parse. Facebook recently bought it and it's super easy to integrate.
(1) is posted if the object is being created using the user access token.
When the app access token is used, then (1) is not published.
Of course, you should not use the app access token on the client side.
Related
I want to show a Embedded Post in my website, but I want it to be always the latest post on my fanpage.
What I'm trying to do is:
Query the posts by making a GET request to https://graph.facebook.com/{FANPAGE}/posts?access_token={TOKEN}
Get the ID of the first object
Add the plugin to DOM on runtime using the ID
The problem is that I can't figure it out how to get a permanent access token (or equivalent) - since I can't update it every time it expires and I don't want the user to login just to be able to see the plugin.
Can this be done? How?
You can use a page access token, or your app access token (the latter will work only if the page is not restricted and posts are not targeted to specific audiences.)
Both of those must never be exposed in public client-side code; so you will need to do this on the server.
I created a Java program that retrieves users personal information and posts. I can retireve everything related to me but not to my friends.
I know that i have to add some extended permissions to collect information about my friends (e.g. friends_groups, friends_interests, friends_subscriptions and more) but i don't know how to add them.
I didn't use Facebook Api in my Java application. I just give a specific URL, for example :
https://graph.facebook.com/friendID?access_token=MY_ACCESS_TOKEN_HERE
and i get a JSon Object from this URL which contains the information of that user (id, first_name,last_name,link,name,updated_time) which are not useful for what i want to do.
I also tried :
https://graph.facebook.com/friendID?access_token=MY_ACCESS_TOKEN_HERE&scope=friends_activities,friends_birthday,friends_status,friends_subscriptions,friends_work_history
but again it didn't work either to my Java App or Graph Api Explorer.
Can someone explain to me how to add the extended persmissions that i need provided that i created my app in the way i explained above? Can i add the permissions inside the URL that fetches the JSon Object?
To get a person's data, your app needs to use that person's access token. To get that person's access token, that person must authorize your app (through Facebook Login). You can read more about Facebook Login in the documentation.
I am planning to build a small side project that stores posts from particular public pages. And detect if they delete the post later. Something similar has been done for Twitter. But I couldn't find similar projects for Facebook.
Like this: http://politwoops.sunlightfoundation.com/
But for Twitter. I will do it in Python or C#
How can I go about it?
Any particular code or projects I can learn from?
The only way to check if a post is not there anymore on Facebook is to search for it with a User Access Token of the User who posted it. Every Object on Facebook gets a specific ID, you only have to check if that ID still exists. If not, you get an Error from the API.
For example: https://developers.facebook.com/tools/explorer/?method=GET&path=10203433018378479&version=v2.0
The path parameter is the ID of the Post.
Keep in mind that you need the read_stream permission for that, and you need to let Facebook approve it for other users or it will only work for Admins/Devs of your App. It is not very likely that you will get the permission approved for this though. It usually only gets approved for Apps on "Platforms without a native Facebook experience".
Edit: My bad, i was thinking about User posts, but your question was about Pages. In that case, all you need is an App Access Token (App-ID|App-Secret). The API Call would be the same, you just need to know the Post ID.
About Access Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens/
http://www.devils-heaven.com/facebook-access-tokens/
For getting the feed of a Facebook Page, see the Facebook docs (including code samples): https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed/
You can use graph api for this. If it's a public page, you can follow these steps:
Create your application in Facebook developers site
Setup the basic graph auth mechanism with your favorite language and get unexpired token.
Use your unexpired access token to do these tasks:
Enter the id of the pages you want to crawl http://graph.facebook.com/[insert page id or url here]/feed
Add post title, postID to your database.
Create a scheduled task on your server to do these tasks:
Select all / page based etc posts on your database and send a request to: http://graph.facebook.com/[insert post ID here]
if it returns it means it's still there. otherwise it will return an error.
I've been trying to use Facebook's new "user owned" objects as a way to track progression/scores in a mobile Unity game, for the user and their friends. So for each "level" completed I create a new myapp:level object.
Whenever an object is created like this, though, it shows up in the user's activity log as "User posted Object Title". I mostly just want to use these objects as data storage, and as a way to for the app to query and display your friends' data. I only really want to post a custom action (e.g., myapp:complete) if the user explicitly chooses to share it from within the app.
Not only does it generate these posts, it also create a new custom object type in my app's type definitions, simply called "Object", and an action type called "Post" (which seems to actually be og.posts). I even have to submit this auto-generated Post action for review, which seems odd.
Can I somehow disable the post action or is it an intrinsic part of creating user owned objects? If I can't disable it, is there any way I can hide it from the user? I can't set no_feed_story on the action as the action is implicit from the object creation.
(Note, I'm not using the Facebook 3.5 SDK on iOS, but using the Prime31 Facebook plugin for Unity, on Android, but really I'm just sending graph requests as specified on the Object API page.)
I don't think it is the intention of Facebook user owned objects to act as a data store?
Anyway, the way the graph works is that all things you publish is an actually an action. Even when posting objects. What is published on the users timeline, is the action of posting this new data item to the social or open graph.
Bottom line: you cannot get rid of this posted thing, as it kind of defies the purpose of Facebook being open and social.
I'm trying to build a Facebook App that will run in the Canvas on Facebook. I want to give users the ability to create custom open graph objects. For example I want users to be able to make a donation bucket. Title, Description, amount needed, time left, goal. I want the user to make these and then when someone contributes it will post saying "USER_NAME added to the donation TITLE"
Is it possible for users to create objects in this way? Most of what I've seen is about the developer making objects and users acting on them.
An Open Graph object is basically just an URL, that provides the relevant info via appropriate meta elements.
So where’s the problem? You just provide an URL that provides the data your user entered – this could f.e. just contain an id as GET parameter, which let’s your script read the relevant data out of your database and fill the meta elements with it.