Jins Sebastian
Jins Sebastian

Reputation: 68

Twitter intent's 'tweet' event callback triggering on 'click' instead of 'tweet'

I have some issue with twitter intent share functionality, the "tweet" event triggered on click the share button itself(before opening the popup). I have checked the "click" and "tweet" events and both events are triggered simultaneously.

twttr.ready(function (twttr) {
    twttr.events.bind(
        'click',
    twitter_share_callback);
    twttr.events.bind(
        'tweet',
    twitter_share_callback);

});


function twitter_share_callback(response) {
    console.log(response)
    $("#response").append(response.type+"<br>")
    //code
}

The working example JsFiddle

I Wish to get the "tweet" callback right after successfull tweet.

Thanks in advance for your valuable time.

Upvotes: 1

Views: 2556

Answers (1)

Jins Sebastian
Jins Sebastian

Reputation: 68

Finally i was able to find the reason behind the issue

From November 20th twitter will be making a change to the tweet, follow, retweet and favorite JavaScript events when using Twitter for Websites. They will now be triggered when a user invokes the action in your page, rather than after the action is completed.

For more info https://twittercommunity.com/t/forthcoming-change-to-web-intent-events/54718

Upvotes: 2

Related Questions