Attach a photo to a web intent


#1

I am in need of a way to allow users to click a photo on a web app, which will then redirect them to twitter and allow them to tweet a message with the attached photo. However, there seems no way to do this.

  • Attaching a link to the photo rather than the photo itself in the tweet is not ideal.
  • Making a photo card for each photo is not ideal as each photo card requires approval

This same question was asked last year, with no real solutions. Has the situation changed? Are there any possible workarounds? @rchoi


Attach a photo to a web intent
#2

A Tweet Intent does not support media uploads, user-directed or otherwise.

A Twitter application with write permissions granted by a Twitter user may upload a photo and post to a Twitter account on the user’s behalf.

A link with Twitter Card markup may appear alongside the Tweet. Twitter Card types are granted by domain; only one submission and permission grant is needed for a photo card type on example.com


#3

Hi niall, thanks for the reply.

I’ve made a node app, using the twitter npm module and can successfully upload a photo, but only to the twitter account associated with the app. I am usure of how I would allow users to authorize my app in order to upload photos on their own account.

Could you please provide me some pointers?

Thank you so much.


#4

Sign in with Twitter. Your Twitter application should be set up to request write permissions in the permissions section of apps.twitter.com.
https://dev.twitter.com/web/sign-in/implementing
https://apps.twitter.com/

Upload media.
https://dev.twitter.com/rest/public/uploading-media

Create a new Tweet while passing the media ID.
https://dev.twitter.com/rest/reference/post/statuses/update


#5