Web Intents Programmatically with callback?


#1

Hello,

Is there a way to call web intents (ie. tweet) programmatically?

I’m including the widgets.js file and I’m successfully getting callbacks on clicked <a> links.
However I would like to call the popup from angularjs and still get the callback (I understand you don’t get the callback if the popup isn’t opened by twiiter’s script).

Thanks!


#2

It is on our road map to add an intents javascript API, but it’s not available yet.

However, if you create a link which has a href pointing to an intent url, then widgets.js will send you back events because it listens to all links which point to to twitter intents. Here’s a jsbin to illustrate it: http://jsbin.com/duvaco/2/edit?html,js,console,output

Note: if you trigger the click programmatically, browser will usually block it by default unless the action was initiated by the user.


#5