Display public tweets using hash tag urls in apple tv

tvos
api
appletv

#1

Hi Team,

I am developing tvos app. I want to display tweets of famous personality like Barack Obama, actors etc. I will get hash tag url from my client.
Since, apple tv don’t support the webview, I need to call twitter api, parse response and display tweets in my customized UI.

My Queries are:

  1. Should I use Rest Api or Streaming Api for this?
  2. Do I need to create app on https://apps.twitter.com/app/new and get the keys?
  3. Is authentication required as I am just going to display feeds/tweets?
  4. Could you please provide some docs or sample app link for apple tv to help as I am totally new to use twitter?

Please guide.

Thanks,
Bhavya


#2

That’s a matter of taste for you. The REST API will require you to repeatedly call for updates, the Streaming API will deliver new Tweets as they happen.

Yes and yes. The Twitter API requires OAuth.

You could take a look at something like Swifter or STTwitter. You’ll also need to review our Display Requirements.


#3

Thanks for quick reply Andypiper.

  1. How to get OAuth? (TwitterKit have no support for tvos. Also, Apple tv don’t support webview.)

  2. Should I use Digits integration for OAuth?

  3. I looked into Swifter and STTwitter Library but it looks like it doesn’t have support for tvos. I need to display tweets of apple tv, which are searched by using a hashtag url.

Looking forward for your kind reply.

Thanks,
Bhavya


#4

There are already a number of apps that do display Tweets on tvOS, so you might want to take a look to see how they are doing things. Digits will not help here, as that is not a Twitter API login, it is a separate identity mechanism. From memory, some of the apps are using a separate PIN-based flow or an external auth mechanism on e.g. a laptop or phone. You don’t necessarily need user auth anyway - app-only auth would still give you the ability to search for Tweets, for example, so there’s no actual need for login there.

I suggested Swifter and STTwitter on the basis that they are Swift and Objective-C libraries, which I understood should work on tvOS. I don’t know what alternatives there are out there at the moment.