Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Intent to follow Twitter user?

In my About screen, I would like to allow the user to easily "Follow" my Twitter account.

I was hoping that existing Twitter apps would support some kind of Intent for this. I would rather not use the suggestion here because this requires authentication, AFAICT.

If the user has already installed, for example, the official Twitter app, then it is better for any authentication to be done within that app, if necessary.

I have previously tried contacting those behind the official Twitter app, but received no response.

like image 830
Mark Avatar asked Mar 16 '12 04:03

Mark


2 Answers

This is an old question, but I believe here is now a better way. Use the Web Intent.

https://dev.twitter.com/web/follow-button/web-intent

Basically just use an ACTION_VIEW with the url: https://twitter.com/intent/follow?user_id=<theuserid>

like image 161
BoredAndroidDeveloper Avatar answered Sep 29 '22 03:09

BoredAndroidDeveloper


I just ended up using the standard http-based Intent:

Action:

android.intent.action.VIEW

Data:

http://twitter.com/mytwitterusername

The user can then choose whether to open the Intent in the official Twitter app (or whatever) and easily Follow mytwitterusername from there.

like image 30
Mark Avatar answered Sep 29 '22 02:09

Mark