开发者

Real-time update: the notifications' contain uid and id, but the value are same

开发者 https://www.devze.com 2023-03-31 10:11 出处:网络
The not开发者_如何学Goifications I received from Facebook are all like the following: {\"object\":\"user\",\"entry\":[{\"uid\":\"100002366898088\",\"id\":\"100002366898088\",\"time\":1314270539,\"cha

The not开发者_如何学Goifications I received from Facebook are all like the following:

{"object":"user","entry":[{"uid":"100002366898088","id":"100002366898088","time":1314270539,"changed_fields":["feed"]}]}

I am wondering what does the "id" used for? Shouldn't it be the changed feed's id? Why it always same with the uid?


It is simply stating that the users feed has changed. Sure its redundant in this instance but in other updates you subscribe to it could change.


In certain situations, you can get different IDs in your updates:

I have been using the Realtime Updates API to listen for changes on a Fan Page. To do this, you add your app to the Fan Page and then listen for the object 'user' and field 'feed'.

You get notified about updates to the feed on the Fan Page (in which case you get the id of the Fan Page), but also get notified about updates to your App Owner's feed (in which case you get the Id of the User than owns the app). So you would need to distinguish in this situation, and I guess there may be other similar situations.

0

精彩评论

暂无评论...
验证码 换一张
取 消