Android intends to follow Twitter user?

On the “My Question” screen, I would like to allow the user to easily “follow” my Twitter account.

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

If the user has already installed, for example, the official Twitter application, then, if necessary, it is better to do any authentication in this application.

I previously tried to contact those who were behind the official Twitter application, but did not receive a response.

+6
source share
3 answers

This is an old question, but I think now is the best way. Use web intent.

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

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

+5
source

I just finished using the standard http-based intent:

Act:

android.intent.action.VIEW 

Data:

 http://twitter.com/mytwitterusername 

The user can then choose whether to open the intent in the official Twitter application (or something else) and easily follow it through mytwitterusername.

+5
source

If the user has installed the official Twitter application and logged in, I don’t think twitter4j will ask for authentication again. I previously worked with twitter4j and facebook api, and none of them asked for authentication if the user has already registered ...

+1
source

Source: https://habr.com/ru/post/910875/


All Articles