문제

Facebook realtime docs specify that the callback data is of the following format

{
  "object": "user",
  "entry": [
    {
      "uid": 1335845740,
      "changed_fields": [
      "name",
      "picture"
      ],
     "time": 232323
    }, {
      "uid": 1234,
      "changed_fields": [
      "friends"
      ],
      "time": 232325
}]}

If two different objects, say 'user' and 'page' are to be sent back, does facebook

  • Batch them together?
  • Send them separately?
도움이 되었습니까?

해결책

Different objects are sent in different requests. But if there are many user requests then it will batch those user requests and send it. And also you can have different end points for user and page. The format of page request is also different. It looks something like this

{
    "object": "page",
    "entry": [
        {
            "id": "408518775908252",
            "time": 1360643280,
            "changes": [
                {
                    "field": "feed",
                    "value": {
                        "item": "like",
                        "verb": "add",
                        "user_id": 5900878
                    }
                }
            ]
        }
    ]
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top