Mark
Mark

Reputation: 7718

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.

Upvotes: 6

Views: 4336

Answers (3)

BoredAndroidDeveloper
BoredAndroidDeveloper

Reputation: 1359

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>

Upvotes: 5

Mark
Mark

Reputation: 7718

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.

Upvotes: 5

Amit
Amit

Reputation: 13384

If the user has installed official twitter app and is logged in, I don't think twitter4j will ask for the authentication again. I have previously worked with twitter4j and facebook api and none of them asked for authentication if user is already logged in...

Upvotes: 1

Related Questions