How do I transfer Comments from one Facebook App ID to Another? - facebook

Is there any way to transfer comments from a "deleted" Facebook app (that is still receiving comments) to a new app id? The app was deleted by accident quite some time ago but we now have thousands of comments that have been entered using it. I'm afraid I will lose all of the comments if I simply switch to a new app. The app id seems to function just fine with the commenting mechanism, but I can't manage it or use it in any other way.

AFAIK, there is no automated way of doing this. However, you can read them programatically from your deleted app (provided you have the permissions) and then post it again on your new app.
You can get the original app's feed using the following (PHP) code:
$response=file_get_contents("https://graph.facebook.com/".$id."/feed&access_token=".$facebook_access_token);
$response_array=json_decode($response,true);
// $id: ID of the page where the comments are
You can also customize this query by adding pagination parameters like since,limit,until etc. Please refer to https://developers.facebook.com/docs/reference/api/ for documentation.
And can be reposted to your app by HTTP POSTing to the same URL. See https://developers.facebook.com/docs/reference/api/page/#posts for details.
Please understand that you can't post as the original author - so you can only post the text and perhaps manually add the context of the original author. so i.e:
"Shreeni: 'This is a cool app' "
will have to become
"App: 'Shreeni said: 'This is a cool app' ' "

Related

Using m.me links with ref param

I'm trying to deeplink users into my facebook messenger bot, and I need to pass some data in at the same time. Supposedly this can be done by using m.me links, along with a query param.
My bot's page is https://www.facebook.com/Willy-1610141399078870/
The m.me url would be something like this. https://m.me/Willy-1610141399078870?ref=somedatagoeshere
The m.me link works to a degree on desktop, but the data isn't passed to the bot. I don't particularly need it to work on desktop.
However, when I try to open that link on ios or android, I get an error message.
Android
This user name doesn't exist. Try another code or link
iOS
Username was not found
The bot hasn't been published yet, so it won't be visible to anyone else. I need to be able to test this functionality before I publish, so I hope that's not what is causing the failure.
Has anyone else been able to use this feature?
It seems that the facebook-generated username can't be used for m.me links. It requires you to register an explicit username.
My page's generated name was Willy-1610141399078870, so https://m.me/Willy-1610141399078870 wasn't a valid url.
To register a username for your page, go to your page > About > Create Page #username.
Then, you can attempt to pick a username that isn't already taken. Somehow, #willy-the-test-page is already taken (?), so I got this incredibly confusing error message:
Taking the error message at face value, I decided to create another page and try again. This time, realizing that the message didn't mean what it said. Picking an available username clears the error message, and allows registration.
Just kidding! It will tell you again that the page isn't eligible.
The solution was to create a totally new page, and go through the #username creation flow again. It worked for me on the second attempt.
It's rumored that a page needs at least 25 likes to become eligible for an #username, but this isn't true in all cases.

Getting Facebook event information from URL

I've been reading some stuff about Facebook API's but as a non-programmer it's kinda hard to understand it all. It's probably a pretty simple question.
My question: is it possible to get all the information like coverphoto, time, description, location etc. from a (random) public Facebook event from just the URL of the event?
So I will have a field 'Insert event URL' on my page. Below that I will have some fields like 'Location' 'Start time' 'End time' which will be automatically filled in when the user inserts the URL of an event.
Please let me know! A link to the source with explanation etc. would also be really nice. (It's for a school project)
Yes you can. Ill try to explain you the simplest possible way to do that.
First of all go to : http://developers.facebook.com/apps and create an app.
Then, save the App access token which is: app_id|app_secret
Your url will be of format: https://www.facebook.com/events/{event-id}. Fetch the event id from this. Quite simple right?
Then you are going to use the facebook's powerful graph api. Just get the contents from : https://graph.facebook.com/{event-id}?access_token={app-access-token}
The list of all possible fields that you can get (only if set in the event of-course): https://developers.facebook.com/docs/graph-api/reference/user/events/#pubfields
That's it!

Do Facebook Like Buttons require an App ID?

When going to the set up pages for all the Social Plugins, they now provide example code using an APP ID.
http://developers.facebook.com/docs/plugins/
Is an APP ID now required for the Like Button and other plugins? What happens if an APP ID is not included when using the plugins?
I've checked the Facebook developer blog and read about the Like Button Migration. I haven't been able to find a straight answer for this either there or in the FB Like Reference.
Notice:
This is an old dated information, the official facebook's behaviors are changed.
Simply, the answer is No, just look at the following official Facebook resource.
Notice: To do it without need to the app id, you have to visit the above page when you are signed out from Facebook. Look at the following screen shot.
As semsem said, the simple answer is "no it is not required"... there are ways to get around having an appId associated with the "like" button. Here's my experience working with this. I'm not a Facebook or Open Graph expert, so YMMV.
Why we avoided using the appId on the button:
We're providing an service where we have one website (the engine, as it were) that provides a service distributing online courses to students (customers). Instructors (also customers) who what to use our service to disseminate courses to students can brand the site how they wish, and map their domain to their section of our website that serves those course(s).
As a simplified example: we serve from http://courses.example.com/instructor_name, but we want students to access the content through http://www.instructors-domain.com/. Any courses would be sub-directories off the base URL.
Associating the "like" button with our Facebook App disallows any cross domain shenanigans. While there are valid reasons for doing so, it doesn't work for where we're at in our company and product evolution. So we needed to find a workaround.
We wanted to allow folks to "like" a course, have the "story" point to the appropriate places on the net, as well as get some customization (e.g. "NAME likes an online course on FBAppName"). We basically achieved this. We lost some functionality which we deemed acceptable at this point in our evolution.
The short of it
I used the iframe version of the Facebook "like" button as dictated by the appropriate Facebook developer's page (for the link see semesm's answer for the link, I got no rep). I took their code snippet and manually removed the appId query string in the iframe's src.
In the "liked" page itself (which was the same page that had the "like" button) I used the Open Graph meta tags including specifying the appId. (These tags were specified: fb:app_id, og:type, og:url, og:site_name, og:title, og:description, og:image.)
The og:type was our custom type of the form 'namespace:app_custom_object_name'.
A failed approach
My first attempt was to use what I understand as the preferred method, the "HTML5" tab in the "Get Code" section of the developer's "like-button" page. I tried their method stripping the appId from the appropriate places. This method proved ineffectual.
If the domain doesn't match that in the Facebook App, there will be no "like" button.
If the domain does match, the "like" button will appear. However, it takes 3 clicks to actually "like" something. The first click changes the "thumbs-up Like" icon to a normal anchor with one word that didn't make obvious sense (I forgot what the word was). The second click will brings up the login/authorization window for using our app. The third actually bring up the modern fancy "like" box where you can type in a comment. I didn't find a way around this behavior.
Note that when I specified the appId in this approach on the appropriate domain, it worked as one would expect (though inconsistent with our desired behavior).
I did not try the other two options in the "Get Code" section of the "like-button" page.
Informed speculation and rumor
In my research around this, my overall impression is that requiring an appId is the way of the future for Facebook. Who knows if the old way will be depreciated, probably never, though I didn't find anything in the docs talking about this "legacy" behavior. This makes sense to me with their newer offerings and the advanced tracking that becomes available with this method.
I've seen suggestions that the "likes" used in this manner are akin to second-class citizens... treated as inferior in some respects. In my own experimentation I found the behavior of the fully specified appId (in the "like" button itself) to be different and more accessible and predictable (in terms of Open Graph queries and visibility on my limited Facebook tests) than the partially specified appId. (Again, I've found no solid documentation on this, and did not endeavor to full grok the differences.)
May this info help someone else along. Good luck!
So, I just tried the sємsєм method, as comments say: Facebook want you to login to get the code, and if you have an app, you have to choose one.
But if you don't, it gives you a code without any app reference.
So when you get a code – no matter any app you choose –, you just need to remove the appId parameter in the .js URL (&appId=##############), and you got (for the latest HTML5 code, 6th line):
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
The code for the div element does not change.
I simply use the URL code inside an iframe tag without an appID and it seams to work,
here is an example:
<iframe src="http://www.facebook.com/plugins/like.php?href=<%=request.original_url%>&width&layout=button_count&action=like&show_faces=false&share=false&height=35&appId=" frameBorder="0" width="150" height="25">
</iframe>
According to Facebook's Social Plugins FAQ
Web: If you are using Social Plugins on the web, you do not need to create a Facebook app for integrating a Social Plugin.
iOS/Android: If you are using Social Plugins within a iOS or Android app, you need to create a Facebook app and tie it to your app identifier.
It seems that the official answer is that they are only required for iOS/Android.

Including captions in app generated images

I am having a doubt regarding the Facebook policies. It is being stated that:
IV. Application Integration Points
.....
You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content
earlier in the workflow: Stream stories (user_message parameter for
Facebook.streamPublish and FB.Connect.streamPublish, and message
parameter for stream.publish), Photos (caption), Videos (description),
Notes (title and content), Links (comment), and Jabber/XMPP.
.....
Source: https://developers.facebook.com/policy/
And from the examples & explanation page, it says the following for Photos:
You must not pre-fill Photo captions unless the user manually
generated the content earlier in the workflow. These fields are
intended for users to express themselves. Pre-filling these fields
erodes the authenticity of the user voice.
So, my question is: I have seen 99% of the apps (that I used), is auto-filling caption field for photos with say, something like: You can try it by visiting here: http://www.apps.blahblah.com/appname
Isn't that against the facebook policy ? Or they are not flagged because they are using the extended permissions(publish_stream) instead of the post_actions ?
If it is not allowed for both the permissions, then my next question is, how would we tell the users viewing the photo, the link to the app so that these audiences can also try the app ?
Also, if possible, I would like to see a small example of the caption that would be generated in the workflow as mentioned here in the policies: ...You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow....
Thanks in advance.
It is against policies, but many apps do it nevertheless.
I think a compromise would be to have the user enter their own message, and then just append a little link to the end of that before posting it.
As for the example, what exactly would you like to know/see? You have the user put in a message through a text field/input box/whatever, and set that as the message while posting the image.
Currently its forbidden. User should fill the whole caption text. Adding anything to it also is also forbidden.
You can watch the Facebook policy video about pre-filling here:
https://developers.facebook.com/docs/apps/review/prefill

Open Graph Action and Object Resubmission

As I submit an application for "read" action on Open Graph I received the following response.
Status: Changes needed
Unfortunately, your article.read built-in submission does not meet the read requirements specified at: https://developers.facebook.com/docs/opengraph/actions/builtin/#read. You must give users the ability to turn sharing off/on globally as well as remove an article that was shared within the app. In addition, read actions should only be generated when there is a strong indication that the user is actually reading the article. Please note that we cannot accept resubmission as this time due to technical limitations, so you will need to create a new submission. We plan to have this resolved within the next couple of weeks. We suggest making the required changes and checking back. We appreciate your patience. Note: If you are creating an aggregation based on the object, you need to add 6-7 unique sample objects, and then create a corresponding sample action acting on each of these unique objects. (You can not just create 6-7 sample actions pointing to the same sample object). Submission Checklist: https://developers.facebook.com/docs/opengraph/checklist
Please make changes below and resubmit for review.
Unfortunately, this "guide" is not helping with anything. Firstly, I have no idea where to do this:
You must give users the ability to turn sharing off/on globally as well as remove an article that was shared within the app.
Second of all, I don't even know how to "resubmit"!
Any help would be appreciated.
I was experiencing the same thing. You have to click on the name of your action that you submitted. Once you do that, Facebook provides detailed instructions why they didn't approve the action and what you need to do before you resubmit. Once you review the message, you can make the necessary changes and save the action again. Then you'll have the option to resubmit. In my case Facebook said that I need to provide more detailed instructions what the user needs to do to get an action published. They provided this example: "User must create an account, enable Timeline sharing in the settings, view a product within the app and then click the “want” button underneath the product image to trigger a story". I did that and resubmitted. Hopefully it works this time around. Good luck.
To resubmit, just delete the rejected action and create a new one. You can use the same action name as before. You then go through the submission process again as you did the first time.
Facebook have recently updated their guide to implementing their built-in action types. For the Read action type, see https://developers.facebook.com/docs/opengraph/actions/builtin/#read. You will see a sample application that meets the following criteria required for the use of this action type:
Turn sharing on/off globally on each page an article appears.
Remove articles they shared within your app on each page an article appears.
Only generate read actions when you're sure someone is interested in reading the article.
Built-In actions can't be resubmitted. It is a FB Bug:
https://developers.facebook.com/bugs/364663400220101?browse=search_4f44876aabaef7501649601
From this answer on FB tools and support I got this:
You can start a new submission at the bottom of the "Items in Review" page:
https://developers.facebook.com/apps/337449599791917/review-status/items-in-review/
That link didn't work for me.. so I just went to the app dashboard and clicked on status and review
clicking on the start a new submission button loaded a dialog that prompted me to select which items to "re-review".. so I only selected the problematic one:
after that it loads a form for you to resubmit, so here you gotta re-upload the iOS simulator build etc..
and that's it!