开发者

Facebook "Like" to see canvas page

开发者 https://www.devze.com 2023-01-13 23:11 出处:网络
Ive seen this on a lot of facebook sites. I was wondering how to setup a welcome page and when the person likes that certain page they are then able to see more information about the page.

Ive seen this on a lot of facebook sites. I was wondering how to setup a welcome page and when the person likes that certain page they are then able to see more information about the page.

开发者_如何学Pythonie: http://www.facebook.com/BacardiLimon under the welcome tab.

thanks!

Also a related facebook question. Does anyone know how the slide show at the bottom is created in fbml?


  <fb:fbml version="1.1">
   <fb:visible-to-connection>
   Welcome, fans!
   blah blah blah...
  <fb:else>
 NONFANS
</fb:else>
   </fb:visible-to-connection>
  </fb:fbml>

who knew it was that easy :P


Now that iframes are the only way to create new Facebook apps and FBML is being phased out, you need a new way to do it.

When your app URL is loaded, it is passed a signed_request POST parameter. This parameter contains the information you need. However, it is packed and encoded so it requires some manipulation to get the right info out.

  1. First, split the signed_request on the '.' character. The first part is the signature. The second part is the encoded_data
  2. Decode the encoded_data into a JSON string using the URLBase64Decode function equivalent in your server-side programming language
  3. The JSON object contains a node called "page". This contains a node called "liked".
  4. If "liked" is true, the user liked the page and you display the "liked" version of your app. If false, show the "Please like me" version of the site.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号