Twitter Web Intent on-close callback?

1.1k Views Asked by At

When a user clicks the twitter share button a web intent window is brought up on an already greyed out background (using an overlay). I am curious if there is a callback from the twitter web intent window to know when the window is closed or a tweet is submitted so that I can fade out the greyed out window once the user is done with the twitter intent window. Any help would be appreciated.

2

There are 2 best solutions below

0
On

Using FirstDivision's answer, you can detect a successful tweet, but you will miss the case where the user closes the window without submitting a tweet.

According to this discussion thread, there is no official support for a failure event:

https://dev.twitter.com/discussions/17386

I am not sure if there is an acceptable work-around.

0
On

You can do something like this.

    twttr.ready(function (twttr) {
        twttr.events.bind('tweet', function (event) {
            //do something
        });
    });