Facebook App won't work if website not defined - php

I'm using the plugin Like 2 Unlock for jQuery.
I'm creating WP plugin and adding this plugin to lock some settings content.
When liked, it will be unlocked and people able to manage settings.
The facebook App need the website added to the Facebook App for it to work. Since this is going to be WP plugin, it will be hosted on others people domains. Well, in this case it will not work because their domain won't match with my domain in FB app.
Do the facebook app settings have something where you don't need to specify your website and this way no need to be tied to a specific domain?

Like Gating is not allowed and not possible anymore: https://developers.facebook.com/docs/apps/changelog
You must not incentivize people to use social plugins or to like a Page. This includes offering rewards, or gating apps or app content based on whether or not a person has liked a Page. It remains acceptable to incentivize people to login to your app, checkin at a place or enter a promotion on your app's Page. To ensure quality connections and help businesses reach the people who matter to them, we want people to like Pages because they want to connect and hear from the business, not because of artificial incentives. We believe this update will benefit people and advertisers alike.

Related

Using facebook likes to access fb app

I have created an fb app using a page tab on my fb page. However before a user can access the app I would like the user to like my page first. Is there a way to do it?
Facebook banned this practice in 2014.
https://developers.facebook.com/blog/post/2014/08/07/Graph-API-v2.1/
You must not incentivize people to use social plugins or to like a Page. This includes offering rewards, or gating apps or app content based on whether or not a person has liked a Page. It remains acceptable to incentivize people to login to your app, checkin at a place or enter a promotion on your app's Page. To ensure quality connections and help businesses reach the people who matter to them, we want people to like Pages because they want to connect and hear from the business, not because of artificial incentives. We believe this update will benefit people and advertisers alike.
As a result, Facebook removed any technological ability to do this from the API:
The liked field will no longer be returned in the page property of the signed_request object for Page Tab apps created from today onwards. For apps created before today, from November 5, 2014 (90 days from today), the liked property will always return true regardless of whether or not the person has liked the page.
If you want people to like your page, make it worth liking.

What is Facebook app canvas and page tab?

I have spent a lot of time reading FB dev docs and tutorials but I am still very confused with what canvas app and page tab are and how to use them.
What I am expecting from using FB SDK in my site is to have "continue with facebook" button on login screen , have a couple of share and like buttons and send notifications to facebook if user have allowed that. My site has internal messaging system and I want to notify users that new message or activity has happened in my site. In this way users would not have to check my site every day for activity which is important user experience as I expect rare activity(approx. few activities per week).
I have everything running but after user clicks on notification he is taken to canvas app. FB docs and tutorials focuses on code examples but I have not found anywhere description on what canvas app really is. Without this fundamental understanding I can not complete my notification logic, can not understand the terms involved like "secure canvas url" and basically does not feel confident about user experience(which I would want to make as great as possible).
If I google "what is facebook canvas app" I get "Canvas is an immersive and expressive experience on Facebook for businesses to tell their stories and showcase their products.". Apparently from comment below thats something else...
I would appreacite If someone could explain in plain word and maybe example what is canvas app and how should I use if taking into account that my main goal is to notify users about acitivity in my site to their fb account.
I am using CI framework PHP SDK v5.
Background
In Facebook, you create "apps" that run on "platforms". As a quick, very simplified summary, the three primary types of "platforms" that apps can run are:
A website that you host and control, but integrated with the Facebook Graph API (has Facebook Login, posting etc), but otherwise looks like a normal website. You host these on your own servers.
A website designed to sit inside an iFrame on the Facebook Platform. These apps will also generally interact with Facebook Graph. You still host them on your own servers but you have the added advantage that but can get limited information about the user when the page loads.
Stand alone programs (including mobile applications) that also interact with the Facebook Graph.
What you are talking about is the second of these - the iFrame on Facebook.
Facebook provide two ways to embed the application iFrame:
one is a canvas app. This has minimal surrounds for Facebook Header, Footer and a few ads on the right. It maximises your space. (e.g. https://apps.facebook.com/candycrush/?fbs=-1&fb_appcenter=1)
the other is a "page tab" (https://developers.facebook.com/docs/pages/tabs). This is smaller and designed to sit in a company's "Facebook Page" so has less space. As a marketer, however, it keeps everything more branded to your company. (Example: https://www.facebook.com/NutellaANZ/app/595447743881506/)
Note that a single app can run across all the above - canvas, a page tab and a stand-alone HTML page. With some shifting of the API, you can also wrap the same code for mobile and put on the app stores. A user can log in on your mobile app and you can have them logged in on websites and vice-versa (within some limits, but you'll need to explore those).
Games Only?
You are right in that most of the Facebook docs relating to apps refer to games.
Indeed a good place to start is https://developers.facebook.com/docs/games/gamesonfacebook which is where help leads you for Canvas Apps now.
But it doesn't have to be a game - so long as you're using the APIs anything will work. As you mention PHP, have a look at https://developers.facebook.com/docs/php/howto/example_access_token_from_canvas - no mention of a game, but is how you get information from the iFrame in PHP. (There's a lot more reading to do!).
Reading notifications
When clicking on the notification, Facebook will add parameters to the URL. Some of these are determined by the notification (see https://developers.facebook.com/docs/games/services/appnotifications) and others will help you get information about the user (https://developers.facebook.com/docs/reference/login/signed-request, https://developers.facebook.com/docs/php/SignedRequest/5.0.0).
So use this information server-side to work out who the user is and how you want to handle the user. But what experience you want to give the user once you're in the Facebook eco-system is up to you.

Is it possible to create FB Apps with script?

I'm building a product that involves clients adding their FB app data into my product's dashboard.
In this case each client would have to go to developers.facebook.com/apps and create an app first.
I would want to have a button which says "Create App" in my website that when clicked, would create the app instantly for the client.
So is it possible to create a FB App from my website (with script, not manually) ??
Thanks in advance,
Altin.
It was possible couple of years ago, and now it's been removed.
First of all, I’d think about the question, “does every client really need their own app?”
Maybe it’d also be possible to have all of the stuff you’re planning to do (no details on that) under one app, and have it decide on what data to show based on the fact which client’s Facebook page it gets added to (if it’ll run as page tab app), or by some additional parameter passed to it when calling it. You could f.e. example automatically redirect to a sub-folder on your webspace based on this criteria, that displays individual pages for that client.
If that’s not an option, then yes, your clients will have to set up the basic app themselves (and therefor they’ll need a verified account) – and afterwards tell app id and secret to you. Many of the “advanced” app settings can then be set by you via script – look at what properties are marked as “(Editable via API)” here: https://developers.facebook.com/docs/reference/api/application/
(Although some of the basic settings, like category, description, logo etc. will still have to be set by your client themselves. But other, more “technical” stuff, that the client maybe doesn’t know about and doesn’t even want to be bothered with, like canvas/page tab URLs etc. can be set by you. I’d say that’s as good a compromise as you can get for such a scenario.)

Facebook Connect, how to allow users to find and invite friends to your site?

I've read quite a bit of documentation, and it's all based around on setting up full blown Facebook integration on your site to the point where you're completely relying on Facebook.
All I want to know is 2 things:
1) How do I allow my users to find out which of their Facebook friends have already joined my site
2) And what's the easiest way to let them invite Facebook friends to the site?
The site that does it perfectly and exactly how I want to duplicate is Gowalla at http://gowalla.com/friends/find
Note: I've never used Facebook Connect, however I have an API key somewhere.
You need to become best buddies with the Facebook Developer Documentation, especially the web guide.
Where you can start is the Login With Faces plugin, although the Facepile could apply as well. But understand this: If you're not using Facebook to authenticate your users (i.e., using Facebook Connect*), these plugins will be worthless to you.
In terms of inviting people, there's not going to be a great way to do that. You can implement request forms through the XFBML ServerFbml tag, but that's really for inviting people to other Facebook entities, not your own site. There's the share button but that's not really the same thing as an invite.
**Note: It's actually no longer called Facebook Connect - they are slowly moving away from that moniker. They are moving to the terminology "single sign-on". However, the "Facebook Connect" name still pops up in many places.*

Private Video using YouTube API - Drupal

I want to set up my Drupal site to embed private videos from YouTube. I am the owner of these videos, and I have marked them as private to protect them from the general public.
From the documentation, I have seen how to do an authentication where the user is taken to youtube, has to log in to his account, and consent to give my web app access. Instead, I just want to always be logged in to a designated youtube account that has the necessary permissions. What would be the best way to go about doing this?
It appears that I could use the ClientLogin auth method to get what I'm after, although the documentation sternly warns this is only to be used for desktop applications. I'm guessing it's only for security reasons, because they don't want services storing user's credentials. Obviously that's not the case here, as I just want to log in myself. I'll see how it goes.
There was a discussion on this issue a few months back in the Drupal forums.
The third comment is of interest as it specifically says that private videos can be embedded in your Drupal site and will be accessible once you login to Drupal. I have no first hand experience, so can't confirm or deny.
On a tangent, I've just finished working with developers in a situation where we had two sites, both pwd protected, and we wanted just one login gateway (i.e., once you login to either, you've logged into both). The solution of choice (and this may be way over the top for your needs) was simpleSAML.
try Dash Player for Drupal. What I did is host the videos in the site and this is how they look with Dash Player http://www.salvation123.com/node/35
You can actually add YouTube videos on a playlist just RTM on that ;-)

Categories