Handling Unpublished page in Facebook add_to_page_dialog - facebook

I am adding my Facebook application to Facebook Fan pages through the Facebook Javascript add_to_page dialog. Every thing is working Fine, only the problem with unpublished Facebook pages.
I am retrieving the Facebook pages IDs of all the pages to which the app is added. If a person add it to such a FB page which is unpublished, I can't get the Page ID and app is still added to the Facebook page. I want to prevent the app to add to the unpublished page in case.
The Facebook developer documentation provides no help regarding this issue.
Thanks in advance for taking your time.

All the pages a user administers will appear in the dialog - there's no way to prevent an unpublished or otherwise restricted page from being selected - if you have manage_pages Permission from the user you can act as all of their pages, including the unpublished pages.
If you don't, and need to know which page your app is being loaded on, the signed_request sent to your app when the tab is loaded will include the page ID

Related

Associate Facebook Page likes with website

I have a Facebook page with 50K+ likes on it and a separate website, when analysed with Moz, that only has a few hundred likes (which I believe are coming from WordPress on the site's blog).
For a number of reasons, I would like to associate the two with each other, so is it possible to link my FB page likes to website?
At this stage I don't want a FB Like/Share/Recommend, and simply just want my Facebook page and its like to be representative of my website. I can understand why this might not be possible, but I just thought I would ask.
If it it's not possible (like this post Facebook Open Graph : Associate Website with Facebook Page indicates) to do with Facebook page's pageId, is there way I can associate a FB app (in the form of a website) with my existing facebook page without having to make a new FB page?
There is no way to combine/link Likes of an external Website with the Likes/Fans of a Facebook Page.
About associating an App with a Page: You can install an App on a Page, it is called "Page Tab" or "Page App". Of course you don't need to create a new Page for that, you can install an App on every Page you own. You can also use that exact same App for something else on your external website. Check out the "platforms" in the App settings.

get the facebook user id in fan page using js

I use "html static iframe tab by woobox" to create a fan gate.
The fan gate shows differnt pages for users who liked the page, and another page for non-likers.
I have two aspx pages on my server one for likers and one for none-likers.
For the likers page whitch has an Iframe I link my first webpage.
In this webpage i want to get the facebook userid that is currently in the likers page.
Do I have to create an application in order to get the userid?
Do i have to get the user permission?
How do i use js sdk to do it?
Thanks
Yes, you have to create an App to get the User ID, and the user must authorize your App. See here for further information about login with the JavaScript SDK: https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0
But keep in mind that you will NOT get the real User ID, Facebook made some changes recently and you can only get an "App Scoped ID" - see the Changelog for further information: https://developers.facebook.com/docs/apps/changelog
DonĀ“t worry, the App Scoped ID will not change, even if the User deauthorizes and authorizes your App again.

Fan and nonFan pages for my app

I want my application to have two spare screens, one for the non Fan user (the ones that didn't press the button like) and one for the fans. How can I do that without asking the users to authorize my app? Do I have to use pages or page tabs first? or something else?
I tried with JS SDK and $_REQUEST["signed_request"] but there is no info if the user "likes" the app. I also tried FQL methods, but the most tables ask for the user_likes permission.
I'm totally lost with that and any help would be gratefull.
You can get this from the signed_request parameter, which is added to the request URL for your app on the page tab or canvas URL you provided. The signed_request param contains JSON data which includes the id of the page your app is installed on, and an additional liked field if the user has already liked the page. You can use this field to redirect users to the appropriate view for your app.
See the section labelled "Integrating with Facebook APIs" at https://developers.facebook.com/docs/appsonfacebook/pagetabs/ for more info.

Can a FB App "via appName" link to our Fan Page? - What do you do?

I created a FB App to facilitate FB Connect authentication on my website.
Users can share content from my site to Facebook via the same FB app.
We also created a FB Fan Page to grow our community reach.
However a FB App is a separate entity than a Fan Page, whatever content is shared via our website to FB the App link sends the users to an empty App page while all the fuzz is in our Fan page.
I did an extensive research for this issue and only came up with this useful post here in stackoverflow: "Fan page vs Application Page".
Ideally i'd want the App link ("... via appName") on every shared item to point to our fan page.
I need to know if this is an issue that FB needs to address, if i am missing something and what do you do to solve this situation
Some apps are able to do this :
http://mediafeedia.com/pro/
http://www.postplanner.com/white-label-facebook-app/
I also would be interested to know how they do this.
I've checked all app settings...
No, the App attribution on posts made via the API returns the user to that app's profile page - you'd need to have information there directing them back to your brand page if that's where you want them to go after they end up there.
I think in most cases people would click the name of the page or one of the links in the post rather than that small link at the bottom, no?

Facebook application published on a Facebook fan page... not facebook profile?

I have a Facebook profile of my own, and asociated to this Facebook profile I have a Facebook fan page,,, and I developed a Facebook application that now days is published on Facebook.
What I want is to asociate this Facebook App not to my profile but to my fan page... I mean,,, I know that so I can create a Facebook App or a Facebook Fan Page I've to have a Facebook profile account but I would like to know if I can asociate the Facebook App only to be visible throught the Page...
Your only option is to make the application non-functional for other pages and users. You can do this by checking the POST variables (specifically fb_sig_page_id) to determine which Page you are on (or if you're on a Page at all). If the page ID doesn't match your page, just display a message.
Since applications automatically have Pages of their own created by Facebook, you can't prevent users from becoming fans/liking the application Page. This is one of the problems of the Facebook platform.
An alternative is to use the application Page as the official Facebook Page. This is what I've done with someecards (shameless plug). The application acts as the official presence on Facebook, so the official Page and the application are the same.