Saving facebook id as int or varchar?

后端 未结 7 2082
小鲜肉
小鲜肉 2020-12-29 02:32

My question is more advisory than technical. I\'m writing a Facebook app in which I am fetching some information about the user, including facebook_id.
I was wondering i

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 03:01

    To quote facebook's upgrade notes regarding graph API v2.0 (effective May 2015):

    All IDs are strings. In v1.0, IDs were often large numbers.

    Which (to me) implies that userids are not guaranteed to be numbers. In fact, facebook recommend that you use strings:

    https://developers.facebook.com/docs/graph-api/reference/v2.2/user#fields

    Name:id
    Description: id The id of this person's user account.

    This ID is unique to each app and cannot be used across different apps(...)

    type: string

    Although I must admit I've never seen an alphanumeric id.

提交回复
热议问题