Facebook Feed Dialog simplified? - javascript

I'm trying to add a share button or "feed dialog" as Facebook now seem to be pushing, to posts on my website. I'm basically looking for a way to simply allow users to click the button and be sent to the share preview page to post to their timeline or a friend's timeline etc.
The problem is that I don't really need an app (or at least I don't see the need in an app) and I'd like to avoid using their deprecated sharer url method.
What are my options? Can I use the feed dialog method without creating an app? I've tried going through their documentation but it just confuses me.
I'm not fussed whether it's JavaScript that opens a popup or if it redirects to a separate page (provided a redirect url can be provided to return users to the original page on my website).

you definitely need an app for the FB.ui feed dialog, but the user does not have to be logged in. Without an app, you can either use the sharer.php in a javascript popup, or you can use a like and/or send button. Just make sure to include Open Graph metadata in your page.
https://developers.facebook.com/docs/reference/plugins/send/
Be aware that you should also use an app (id) with the like or send button.

Related

facebook share dialog redirecting instead of popping up?

I have a dynamically generated facebook share button link being generated in JS, here is the url of the button:
https://www.facebook.com/dialog/share?app_id=someAppId&display=popup&href=' + window.location.href;
That all works fine.
My issue is that the "display=popup" parameter in the links query string does not do as it says, instead it redirects to a sharing page when I expect it to popup.
What's more, when I submit the share, I do not get redirected back to my site.
I am new to the facebook sharing SDK and to be honest am getting quite stressed with it.
All I want is a simple share button (I made a custom styled button which is why I use a dynamically generated HREF) that doesn't mess with UX and works, surely it cannot be so complex to ask for?
So in short:
1) How do I make the share dialog popup instead of redirect?
2) If there is no way to stop it redirecting, how do I get it to redirect back once a share is submitted?
3) Is there a problem with the way I have done this?
4) What recommendations would you make if this were your project?
5) Is there simpler documentation or a tutorial series that you may know of for the facebook sharing SDK? Because the docs on the developer site are pretty unclear and hardcore in places, I find.
My issue is that the "display=popup" parameter in the links query string does not do as it says, instead it redirects to a sharing page when I expect it to popup.
You misunderstood what this parameter does.
Of course browsers don’t open a normal link as a popup, just because the URL in the href attribute might or might not contain certain parameters.
The purpose of this parameter is to tell the dialog what setting it will be shown in – and if that’s popup, then the dialog elements are rendered smaller than they would be in the full page version.
1) How do I make the share dialog popup instead of redirect?
By either opening the target URL in a popup yourself (window.open), or by using the JS SDK instead, FB.ui can be used to call the dialogs and will open a popup to do so.
2) If there is no way to stop it redirecting, how do I get it to redirect back once a share is submitted?
For the URL version it is mandatory to specify the redirect_uri parameter, to tell the dialog where to redirect back to after sharing.

display twitter compose tweet pages through an iframe

so i have kind of a strange problem, I am in the process of building my own tweet button which is simple enough just using a link that resembles this <a href="https://twitter.com/intent/tweet?text=YOUR-TITLE&url=YOUR-URL&via=TWITTER-HANDLE">
now this as a link works just fine even with the dumby data prvided the problem is i would really like this page to open in an iframe on my site.. but twitter and other social networks have disabled this capability I am woundering if anyone know's a way i can use some sort of iframe or other tech including I assume an oauth and api which will alow me to send write, and display a tweet that the user can send inside my sight ?
as just using this returns an empty frame
<iframe src="http://twitter.com/intent/tweet?text=YOUR-TITLE&url=YOUR-URL&via=TWITTER-HANDLE">
</iframe>
anyhelp on how or even if I can do this or even a site I can check out that allows me as a user to do this would be greatly appreciated
(just a note I dont wish to tweet on a user behalf but rather display a pre defined text's tweet that enable the user to send without leaving my site or opening a new window )
Seems like it's against their terms of service. I'm researching the same issue now and it looks like you need to setup 0Auth to get an access token and then use the API. I'll report back when I have the full answer.

Facebook Javascript SDK inside a Spotify App, possible?

I guess the title is clear enough.
I would like to import the Javascript SDK of Facebook inside a Spotify App. Mainly to use the Dialog feature.
Does someone know if it is possible?
possible answer/workaround. https://developer.spotify.com/technologies/apps/docs/beta/09321954e7.html
the API has a showAuthenticationDialog, but what it actually does is that it shows a popup that closes when the url parameter is loaded inside that popup. if the authenticatewith facebook isn't enough for you then this might be a possible solution to use, you can use it with facebooks page too. if you just open a link regularly it will open up outside Spotify.
you still might be able to use the facebook js sdk though, but if it uses popups you'll need to use this in it instead.
You don't need the JS SDK to use the Dialog feature. All dialogs have a plain old URL you can send users to (within a popup, or the main window).
For example, the Feed dialog:
https://www.facebook.com/dialog/feed?app_id=YOUR_APP_ID&redirect_uri=YOUR_REDIRECT_URI

How to close a childbrowser in Phonegap build application of Android

I have built an Android application using PhoneGap and for tweeting I have used the ChildBrowser Plugin and now when I hit my tweet button I am able to tweet my post. Now the problem is after that the twitter mobile website gets open and I'm unable to go back to my application.
What I want is as soon as I post, I should get a back button on the childbrowser onclicking which childbrowser gets closed and i get redirected to my application....
I have used this function
window.plugins.childBrowser.showWebPage('http://twitter.com/home?status=\'abcdefg\'');
window.plugins.childBrowser.onLocationChange=TwitterLocationChanged;
window.plugins.childBrowser.onClose=TwitterClosed;
window.plugins.childBrowser.showWebPage(TwitterUrl,{showLocationBar:true});
I use these three methods with the ChildBrowser plugin. It really enhances the control for the app. I can grab the URL from the browser and parse it. This is useful especially for Twitter Integration where I can load the message just tweeted and save it to a database.
You can also modify the .java file and hide the 'prev' and 'next' buttons, so that the user only sees the 'Exit' button. This will return the user to your app (quiet simply the ChildBrowser disappears) but you have a history of the URLs that were visited during that session, and with the QueryString data you can analyse some of how the user interacted.
I don't think its possible. When you open another page on a different domain, you have no more control over it. the users has to exit buy them self

Embedding Facebook Connect In A Facebook Page

Our site allows users to register using Facebook Connect. We also have a Facebook page. We'd like to include the "Connect with Facebook" button in our page so a user could instantly connect (aka register) and then be forwarded on to their account on our site.
I was hoping to use the Static FBML page application and the FBML iFrame tag to simply embed the button but it looks like the iFrame tag isn't allowed in Facebook pages. Facebook Connect uses JavaScript so I'm wondering if there is some kind of trick I could use like popping up a page in a new window that would automatically display the connect dialog box.
Any ideas on how I would include a Facebook Connect button on our Facebook page would awesome!
Thanks in advance for your help.
I think the best method would just be a link back to your site (you could even use the Facebook Connect image as the link) to a custom page that triggers the FB.connect javascript that's needed.
Check here for info about FB.connect.requireSession().

Categories