Using facebook likes to access fb app - php

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.

Related

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.

Facebook App won't work if website not defined

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.

Facebook Can you check if someone has liked a third party page?

I'm really not sure if this is doable or not.
I'm working on a website at the moment third party companies can post content on this website.
For those companies we are going to include a Facebook like button so users can like them on Facebook.
When the page loads if there a way we can check and see if the user has already liked the brand? Assuming the user is signed in to Facebook.
Is they have we'd like to display slightly different content.
I think if this was my brand I could access the information via the API but with it being a third party I doubt that would work.

How to remove 'via app' when posting on facebook page feed

When posting to the page wall (feed) through my application, under the post contents facebook adds '20 minutes ago *via my_app*'. This is a problem for my company, since they don't want the fans knowing the posting is done through an application, thus losing the personal touch.
Is there any way to lose the '*via my_ap*p' part of the post? These are some of the things I have tried:
I have given every possible permission on the page admin user, including 'manage_pages'
Have tried with the token returned from graph api me/accounts for that page / Impersonating pages
Please tell me, short of making a bot to do the whole thing, is there any way to do this through the facebook api.
Thank you for any help you can provide.
If you don't want the people to see which company you are, then Facebook is the wrong platform for you!
I'm pretty sure, you also would violate the terms of Facebook (Developer).
See what your competitors are doing. The largest company in this business has named their app "Publisher". When users click on this a page will open up that doesn't say anything about who created the app - actually it doesn't say anything at all. You could also use the name "Publisher" for your Facebook publishing app - in Facebook app names don't have to be unique.

Post to multiple user profiles from a Facebook app

I am developing a web application that I want to integrate with both Twitter and Facebook. At a certain time, messages will automatically be published on every user's feed, for both their Twitter and Facebook accounts.
I am currently working on the Facebook component. I know that in order to post to a user's feed on Facebook they must grant my app the publish_stream permission. Suppose I have a database of many users who have granted this permission. I want to publish a message on all of their feeds (visible to their friends). do I need to go through the database one-by-one and do an API call to post the message for each of them? This is the only way I can think of at the moment to do this, and it seems excessive to do this especially as the database gets larger and larger.
Is there a more efficient way to do what I describe?
Thanks.
I say its the only way to do it - anyway - what you say looks like bulk messaging which might be thought as spam from facebook privacy policy point of view. If you want to use facebook's platform to do the spreading of the message, then create a facebook page and make your apps users to like that, otherwise you'll have to do it "by hand" - sending the message to each one of your users. This has a positive side effect - you can personalize the message for each of your user (mention their name, their friends name, etc), making your application more social.

Categories