Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
684 views
in Technique[技术] by (71.8m points)

javascript - Like FB page doesn't fire edge.create event after confirming

The following codes have worked before but not now. Since FB added the confirm box when liking a page, the edge.create was no more fired after confirming.

    <div class="fb-page" data-href="{{ $fbPageUrl }}" data-tabs="timeline" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true"></div>
    <script>
        $(document).ready(function() {
            $.getScript('//connect.facebook.net/en_US/sdk.js', function(){
                FB.init({
                    appId      : 'xxxxxxxxxxxxxx',
                    xfbml      : true,
                    version    : 'v2.9'
                });

                FB.Event.subscribe('edge.create', function(response) {
                    alert('Fired!');
                });
            });
        });
    </script>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can no longer subscribe to edge.create. At this time (04/2018) it is still in the documentation, but it is deprecated and to be fully removed in the near future.

By design, there is no way for a third party application to know when the Like button is clicked.

You will need to design your app in a way that does not require you to know when the Facebook Like button provided in the iframe is clicked.

Referencing this bug report:

The edge.create event is deprecated (https://developers.facebook.com/docs/plugins/faqs/), so the engineers have decided not to fix it for this case since it will be taken out completely in the future api release.

And from this one:

I understand that it's important to you, but unfortunately we did the deprecate on purpose due to policy issue.

Developers are not supposed to check the user press any more.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...