There are buttons "Share" VKontakte, Twitter and Facebook.

When the user clicks, a dialog box opens and clicks Share. I need to know the answer - did the user share or not? The API did not find anything like it.

Who can offer? How can I get an answer? If it were possible to frame the dialog box, then it was possible to handle the event of clicking on the Share button, but alas.

You can still without dialog boxes, but I do not know how to do it.

    2 answers 2

    In the HashCode with the API it seems - not very, found a solution. To find out the answer, you need to connect

    VK

    <script type="text/javascript" src="http://userapi.com/js/api/openapi.js?49"></script> <script type="text/javascript"> VK.init({ apiId: ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€_прилоТСния, onlyWidgets: true }); </script> 

    Fb

     <script src="//connect.facebook.net/en_US/all.js"></script> 

    Twitter

     <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> 

    Next for VK

     VK.Observer.subscribe('widgets.like.shared', function(likeCount) { //Ссли ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ ΠΎΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π» ваш пост }); 

    For FB

     FB.Event.subscribe('edge.create', function(opt_target) { //Ссли Π½Π°ΠΆΠ°Π»ΠΈ Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ "Ρ€Π΅ΠΊΠΎΠΌΠ΅Π½Π΄ΠΎΠ²Π°Ρ‚ΡŒ" }); 

    For tw

     trackTwitterHandler_ = function (intent_event) { var opt_target; if (intent_event && intent_event.type == 'tweet' || intent_event.type == 'click') { var socialAction = intent_event.type + ((intent_event.type == 'click') ? '-' + intent_event.region : ''); //Ρ‚ΠΈΠΏ наТатия //Π½Ρƒ, ΠΊΠ°ΠΊ ΠΏΡ€ΠΈΠΌΠ΅Ρ€, ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠ° Π½Π° Ρ‚ΠΎ, Ρ‚Π²ΠΈΡ‚Ρ‚Π½ΡƒΠ»ΠΈ Π»ΠΈ if (socialAction == 'tweet') { //Ссли Ρ‚ΠΈΡ‚Π½ΡƒΠ»ΠΈ } //Π΅Ρ‰Π΅ ΠΌΠΎΠΆΠ½ΠΎ ΠΎΠ±Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Ρ‚ΡŒ Π½Π°ΠΆΠ°Ρ‚ΠΈΠ΅ ΠΏΠΎ числу Ρ‚Π²ΠΈΡ‚Ρ‚ΠΎΠ² ΠΈ Ρ‚Π΄}}; intent_handler = function (intent_event) { trackTwitterHandler_(intent_event); }; twttr.events.bind('click', intent_handler); twttr.events.bind('tweet', intent_handler); } } 

      Personally, this code did not work for me:

       VK.Observer.subscribe('widgets.like.shared', function(likeCount) { //Ссли ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒ ΠΎΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π» ваш пост somefunction() }); 

      I did this:

       var somefunction() {}; $('#vkshare0 a').click(function(){ VK.Observer.publish("widgets.like.shared",8); })