dongxia8656 2012-01-19 15:30
浏览 28
已采纳

如何验证用户是否超过18岁

I am building a Facebook application which should not be viewable to anyone under the age of 18, as it makes quite extensive use of the Graph API I wonder is it possible to automatically find the age using that.

Looking at the documentation I can see that it should be possible to find a users age-range using signed requests. However I've not managed to find any actual examples of how to implement this.

Ideally I'd like to be able to end up with a variable which had either TRUE or FALSE as it's value. True being over 18, false being the user is under-age.

I contemplated asking for birthday permissions and calculating the age using that however it seems that many of my friends do not show their birth year so I assume many others do the same, I'm guessing that if the birth year is hidden it will not be accessibly to the Graph API.

Could anyone help me with this?

Thank you.

  • 写回答

3条回答 默认 最新

  • duan1982453 2012-01-19 15:36
    关注

    You could just restrict the entire app programmatically so the app and all its content is only visible to users that meet your restrictions, there's an API for that: https://developers.facebook.com/docs/reference/api/application/#restrictions

    There's an example of how to do this here: https://developers.facebook.com/blog/post/574/

    Failing that, if your app is running as a page tab or on canvas (i.e apps.facebook.com/something ) the signed_request sent to your app has an approximate age range included

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序