Normally, when making a request_token on Twitter, I think that I would log in via a browser and give permission to a third party, but with iOS there seems to be a way to do it via an app. I didn't know how to do this when I searched the documentation, so I asked a question.

feather, Etc. adopt it.

If you go through the app, it will look like the screenshot below.

Probably it can be done in the form of twitterauth: //authorize? Consumer_key= xxx &consumer_secret= zzz &oauth_callback= yyy-xxx like the link below. I will try it when I get home. twittercommunity.com/t/ios-correct-url-for-in-app-authorization/…

zunda2022-01-13 17:06:14

The Twitter library Swifter also had this description. github.com/mattdonnelly/Swifter/blob/…

zunda2022-01-13 17:06:14

I tried it, but for some reason, if I go without the oauth_callback query, the authentication screen opens on the Twitter screen, and if there is an oauth_callback query, it does not transition to the authentication screen.

zunda2022-01-13 17:06:14
  • Answer # 1

    Swifter also has a function that can be authenticated via the app, but this seems to have been available as a remnant of the time when twitter-kit was supported. It's still not publicly supported, but the functionality itself seems to remain.

    So it seems to work if you do the same way as twitter-kit.
    However, since the consumer_key is easily viewable in the form of using the consumer_key for the URL Scheme, I considered it dangerous to use and decided to discontinue the implementation.

    Basic method

    I didn't work, but it should work in the following way.

    • In your URL Schemetwitterkit-\ (consumer_key)The set

    • Access the following URL

    twitterauth: //authorize? consumer_key= \ (consumerKey) & consumer_secret= \ (consumerSecret) & oauth_callback= twitterkit-\ (consumerKey)