dssk35460 2011-11-08 23:12
浏览 17

Facebook高级内容

https://developers.facebook.com/docs/creditsapi/ info and sample codes about payments are available from this souce link. I need to learn how to show or hide content in my app. Like if a user is paid and has premium account, that user should see the exclusive content but the free user should not see the exclusive content. I mean;

Paid users will see "A" content...

Free users will see "B" content...

I want to divide the things my users can see, if they're premium or not.

Thanks for helping!

  • 写回答

1条回答 默认 最新

  • doutong4088 2011-11-08 23:36
    关注

    I don't have muich experience with the Facebook API, but I believe this snippet from your link is what you are looking for:

    When this has been completed, Facebook will once again callback to your callback URL with the method "payments_status_update" and the "status" variable set to "settled". This is when you will definitively know that the transaction was completed successfully and you can then perform any operations to give the item to the user.

    All you need to do is to record a flag in your database field. NOTE: I am assuming you have lots of products stored in a products table, and lots of users stored in a users table. In the users table, you would probably have to store their facebook id (not the username, the numerical ID), to identify them in the future.

    1. When facebook does a call back to payments_status_update with the status set to settled, you need to create a link between the products and users table using an intersection table called products_users. (This means that the user now owns this product/content).

    2. When the user hits your app, you grab their numerical userid, and then check if a link exists between their ID and the products table via products_users. If there is, you can write an SQL query to retrieve a list of products they have brought. Based on this, you shoudl be able to determine if the user can see the premium content or not.

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大