Trouble validating a Facebook token

前端 未结 1 1529
[愿得一人]
[愿得一人] 2021-02-15 15:34

I\'m building a small Facebook login library for OS X. This isn\'t because there are no SDKs out there, but because I\'d like something native to Cocoa that can encapsulate the

1条回答
  •  悲哀的现实
    2021-02-15 16:00

    The debug API is for if you want to do things as the app, not as the user. Once a user has logged in, all you need is their access token to get info about them, read their info, publish things (all of course assuming you have an access token with permissions to do what you're trying to do). So in your case, now that you have an access token, go ahead and try getting info about the user using

    https://graph.facebook.com/me?access_token=%@
    

    and you'll get back something like this:

    {
       "id": "542440888",
       "name": "Max Rabin",
       "first_name": "Max",
       "last_name": "Rabin",
       "link": "https://www.facebook.com/MY_USER_NAME",
       "username": "MY_USER_NAME",
       "birthday": "11/22/YEAR",
       "hometown": {
          "id": "110970792260960",
          "name": "Los Angeles, California"
       },
       "location": {
          "id": "110970792260960",
          "name": "Los Angeles, California"
       },
       "bio": "There are 10 kinds of people in this world.\r\n01: Those who know trinary\r\n02: Those who don't\r\n10: Those who confuse it with binary",
       "gender": "male",
       "email": "MY_EMAIL",
       "timezone": 2,
       "locale": "en_US",
       "languages": [
          {
             "id": "106059522759137",
             "name": "English"
          }
       ],
       "verified": true,
       "updated_time": "2013-10-21T10:02:49+0000"
    }
    

    0 讨论(0)
提交回复
热议问题