update database when a user shared a link to facebook

前端 未结 4 2077
既然无缘
既然无缘 2021-01-06 15:45

Is it possible to update database once a user shared a link in my website?

Such as,some points will be awarded to their account if they shared the link.

And

4条回答
  •  伪装坚强ぢ
    2021-01-06 16:27

    Update(Aug 21, 2013): Facebook's api has changed since the time this was originally posted. The way to track likes is still the same (read original answer below), but the status of the share button has changed.

    The deprecation message/info. is no longer visible anywhere in the docs, but it can be seen in this bug. The share button still seems to be usable according to this doc. But there is no direct way from facebook to track a share. I'm not aware of any hacks to track shares either.


    Original answer:

    From Facebook docs at this link.

    The Share button has been deprecated in favor of the Like button, and will no longer be supported. Please use the Like button whenever possible to drive maximum traffic to your apps.

    So I'll tell you how to do it for a like button:

    First use the Javascript sdk

    Somewhere in your page include the like button

    
    
    

    You can also change the word that is displayed in the like button, from like to recommend, you should try and auto-generate your like button code from this link.

提交回复
热议问题