Facebook Post-Remove URL not called when app removed - facebook

I'm testing the post-remove URL call that should be pinged via POST when my Facebook application is removed, but it doesn't seem to be called.
Monitoring the network traffic in firebug and looking at the POST made when removing the app, the POST does not directly call the Post-Remove URL I specified in the app settings, nor does it pass the POST variables I expected per the documentation.
I set up a simple output at the URL specified "remove page called" that I'd expect to see as the response but don't.
Lastly, the URL called should remove database items which do not get removed.
I don't have any evidence that my post-remove URL is getting called at all. It seems I'm not the only one having this issue but not much insight has been provided.

Answer posted by folks on the Facebook Devleoper forums

Related

Is there any API for fetching metadata of article using Facebook Open Graph Object Debugger?

I want to fetch metadata of any web-page using Facebook Open Graph Object Debugger.
We can get it from this URL: Open Graph Object Debugger
Example: Open Graph Object Debugger for Google
It will provide all the information related to that URL. Is there any way to get this information using API(in JSON format)?
Yes, via the API URL Object described here and in even more detail here. Note that you can issue a POST request to this URL to force a refresh. You can even get additional data such as how many times that link was shared on Facebook!
https://graph.facebook.com/v2.10/?fields=og_object&id=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt2015381%2F&access_token={YOUR_TOKEN}
I did experience inconsistencies, namely if the obejct does not exist the API will return nothing but if you query it a few seconds later it will be there. For this reason we could not rely on Facebook and simply fetched the page ourselves and parsed out the og:* tags.
It may be perfect if you don't care about misses and having to re-fetch or if you just want to programmatically clear the Facebook OG cache.
It's wise to post to it every time you create a new page to force the cache or sometimes the first person to paste the URL into Facebook won't get the link preview!
Yes you can use this https://urlmeta.org
Its usage is pretty simple. Just make a GET call and pass the URL to API endpoint: https://api.urlmeta.org and you are done.

Facebook share dialog (URL Redirection) get response/feedback on redirect uri (redirect_uri)

I'm using Facebook's share dialog with URL Redirection as shown here:
https://developers.facebook.com/docs/sharing/reference/share-dialog
Everything works fine, but the problem I'm having is that I need to get some kind of response or feedback in the redirect uri to know whether the user has published or cancelled the share.
I thought the post_id would be included as query string when redirecting. But this is not the case... I just get a trailing #_=_
So... is it possible to get somehow the response or some kind of feedback when redirecting to know whether the user has actually published the post or not?
Please also note that I cannot use the FB.ui API as the callback is
not working at all when using it inside a web mobile view.
Thanks!

Breaking change with link field when posting to facebook feed via api

We have a facebook website application that posts to user home page feeds as well as feeds to pages which they administer.
Until recently everything worked fine (maybe until the beginning of the year when the 1.0 API was discontinued). The problem turns out to be the presence of the "link" field.
All is well when posting to a user home page. But when we post to a another page the user is an admin of (or a group), the call fails with the following error.
The error that returns is:
{ message: '(#200) Permissions error',
type: 'OAuthException',
code: 200 }
Removing the link field is enough to make the call work again. I had thought we might affected by this issue: Stream post URL security - Website/FB page url. However, our applications Stream post URL security migration is set to off and we are linking to a url in our domain. When posting to a home page the url can be within our app domain or without and all works fine.
As I've been testing I've boiled the calls down to the following in every version of the api.
{{facebookId}}/feed?link=http://cir.cl
{{pageId}}/feed?link=http://cir.cl
For the former we use the long-lived token we got after authenticating. For the latter we use the token returned by {{facebookId}}/accounts or {{facebookId}}/groups. The former works. The latter fails, but changing link to message=foo works fine.
Has anyone noticed a breaking change that touches on this issue?
It turns out it's a valid bug and our friends at Facebook are addressing it:
https://developers.facebook.com/bugs/755514351208694
How often does that happen? I'm just surprised the internet isn't blowing up about this. Dozens and dozens and dozens of applications must be affected.

Facebook app special gifts implementation?

Example: Bejeweled Blitz frequently runs events and promotions that, when clicked, take you to their app page. Once there, the app can see that the page was reached by following the promotional link and forks over the reward.
How is this done? What do I need to do to implement a similar feature? To my knowledge the parent URL is out of bounds due to the domains being different (Facebook vs. my app), so how is the message passed to the app?
Every app (Canvas, Page tab)
You can get data by passing an app_data parameter to any URL linking to a Facebook app. This parameter value will then be added to the signed_request.
As so, this url http://facebook.com/mypage/app_123?app_data=promotion12 will allow you to get promotion12 via the signed_request.
In PHP, this would give you something like this:
$signed_request = $facebook->getSignedRequest();
$app_data = $signed_request['app_data'];
Of course, you could pass any string by there; for example it could be a JSON string.
That's really the heart of getting data from outside to inside an app.
Hope this help you out!
Canvas app
In Canvas app however, it's much simpler, every query parameter will be passed to the app.
So, http://apps.facebook.com/myapp?somedata=hey can be get via:
$data = $_GET['somedata'];
Facebook will just append those parameter to the iframe URL.
Docs
https://developers.facebook.com/docs/reference/login/signed-request/ (was pretty hard to find, damn FB documentation)
This is done with the query parameters passed in the URL that users click on. A clear example is DoubleDownCasino sharing an URL for their users to click on. The link is:
http://apps.facebook.com/doubledowncasino/?pid=PNNTDP&target_url=pid%3APNNTDP
What DoubleDownCasino probably does is once their canvas app loads, they parse the URL for the query params and the pid and target_url parameters help determine what type of "reward" the user gets. Once they redeem it, clicking the same URL won't get the reward again because it can check if the user has already redeemed the offer with the given pid and target_url.
Your question:
Example: Bejeweled Blitz frequently runs events and promotions that, when clicked, take you to their app page. Once there, the app can see that the page was reached by following the promotional link and forks over the reward.
What I explained above is exactly how Bejweled Blitz does it in this post. If you follow through the bit.ly short URL, the URL is:
http://apps.facebook.com/bejeweledblitz/?zgift=0/eTtVUuhF5ipdJmO1jlDhr96MtKjp1NYflJrcOddB6iZDH1y96K%2Bml6gC0%2B5yVN
So answering your question, Bejeweled Blitz run promotions and rewards by appending query parameters, which in this case is zgift, which they can then parse in their app by getting the current URL the user is hitting.

Open Graph calls generating OAuth Exception

I'm experiencing some problems getting an Open Graph implementation working.
As far as I can tell, I have the correct meta tags present. When I paste an URL into the Open Graph Debugger, it returns with the proper information defined (title, description, image, etc), and no errors.
I have version 3.1.1 of the Facebook PHP SDK.
I have Open Graph enabled for my development app, and I have an action (read), and an object (article) defined.
The implementation in question is a website, not a facebook application. On facebook, the app's "category" is "other". I followed some advice in another thread, and changed it to "Game", which did not work, so I have changed it back.
I authenticate my web app user with facebook and receive a code, which I then trade in for an access_token, pretty standard. I ask for the following permissions:
publish_stream
publish_actions
offline_access
However, when I attempt to make a call to publish an action, I receive an OAuthException, and have no real way of debugging it.
Some oddities:
The graph API doesn't seem to like the URL format specified in the documentation: me/[app_namespace]:[action_type]. In my case, this would be me/' . FB_APP_NAMESPACE . ':read, where FB_APP_NAMESPACE is defined earlier to be a namespace as defined in the facebook application settings. Both the API and the Graph API Explorer throw an error stating that it doesn't understand the action given. It seems to be trying to read the namespace as the action.
If I remove the namespace from the url, it reports that the passed in action doesn't match the og:type defined in the url, since the og:type in the url contains the same namespace I removed.
If I remove that namespace from the meta tag, and try again, I get a generic OAuthException that I can't debug.
When I look at the code sample provided in my facebook app, the action seems to be news.reads instead of just read.
If I use that action, the graph API returns an error saying that my ID is unauthorized to use the open graph, as it is not an admin, dev, or tester for my application. Unfortunately, I am the app creator, which means either the graph API is lying, or I am lying to myself!
I think the solution is pretty simple - perhaps I have forgotten something, or selected a certain category incorrect. Either way, this is a little frustrating, to say the least!
Apparently, facebook's default read call isn't available to use if your application/action isn't submitted.
I ended up creating my own read action, and it worked on the first try. Go figure.
For predefined actions the post url's are slightly different, you will have to use something like this:
POST https://graph.facebook.com/me/news.reads?article=[article object URL]
See: https://developers.facebook.com/docs/opengraph/actions/builtin/#read