1

I have seen this in many apps where user is first asked to click like button and then redirected to the main app. How can I achieve this?
I am using php.
Adding a like button on top of the app pages doesn't attracts much likes.

Any help is appreciated!
-Sandy

Sandiip Patil
  • 456
  • 1
  • 4
  • 21
  • possible duplicate of [User must like page before viewing](http://stackoverflow.com/questions/7858141/user-must-like-page-before-viewing) – Maerlyn Jan 04 '12 at 10:17
  • @Maerlyn thanks for the link. it actually is useful, but it is regarding a fan page, what I want is for facebook-app. Although I found the bit of code i need. – Sandiip Patil Jan 04 '12 at 11:27

1 Answers1

1

There are so many solution already for this. Basically you just need a javascript script to hide the main page , and a php script to show the page so that until the user cliks like, then you show it.

A simple searching gave alot of code.

check this ones on stack, or this one and also, this one

Basically, you have to use jquery to hide the page hope this helps!

Community
  • 1
  • 1
Smith
  • 5,765
  • 17
  • 102
  • 161
  • Thank You for help. I found this code useful. $signed_request = $facebook->getSignedRequest(); // Return you the Page like status $like_status = $signed_request["page"]["liked"]; if($like_status) { echo 'User Liked the page'; // Place some content you wanna show to user }else{ echo 'User do not liked the page'; // Place some content that encourage user to like the page } If user has not liked the app I want to put a like button in the 'else' block above. I put a iframe like button code but its not showing anything. The like button should redirect to my app. Please help – Sandiip Patil Jan 04 '12 at 11:46
  • did you read the links i posted, check this http://www.hyperarts.com/blog/facebook-fan-pages-content-for-fans-only-static-fbml/ or check here http://www.google.com/search?num=100&hl=en&client=opera&hs=nqS&rls=en&channel=suggest&q=facebook+app+%22click+like%22+button+before+view&oq=facebook+app+%22click+like%22+button+before+view&aq=f&aqi=&aql=&gs_sm=e&gs_upl=222828l232836l0l234164l13l13l0l0l0l0l882l882l6-1l1l0 – Smith Jan 04 '12 at 14:41
  • I read those links and I got the above code from there but my problem is it remains on the page even after the like. I want the page to either refresh or redirect to my app. Also I am doing this for app not for the page. i.e. the user should be able to see the app if he has liked it already or should see the like button. Please help as I searched lot of things and getting back to zero. – Sandiip Patil Jan 05 '12 at 04:23
  • look at the google link i posted, it contains alot of examples – Smith Jan 05 '12 at 19:09