Can I get Tweets from DataSource objects

ios

#1

Is there a way to get Tweets or TWTRTweet objects from TWTRSearchTimelineDataSource or from TWTRCollectionTimelineDataSource? There does not appear to be a way to access Tweets directly from either of those classes.


#2

Can you explain a bit more about what you’re looking to do or accomplish @AriopolisNow?
-Mike


#3

For our current app, if the user has allowed access to Twitter we are able to display a list of tweets that contain tweets for a user and for hashtags. We are interested in using Fabric so that our users can still view tweets without requiring Twitter access up-front. Before we display tweets we are merging, chronologically, tweets from a user and tweets with specific hashtags. We are using the Twitter APIs, which is also possible using Fabric, but according to the documentation requires the user to follow the Twitter login flow.

With the Fabric SDK it is possible to get user timelines and it is possible to perform searches, and the results(from what I can tell) are contained in TWTRCollectionTimelineDataSource, TWTRListTimelineDataSource or TWTRSearchTimelineDataSource however the only way to get access to the tweets is in a TWTRTimelineViewController. None of the dataSource objects seem to allow direct access to tweet objects. This prevents us from merging the two different sets of tweets.


#4

Thanks for confirming @AriopolisNow, you can use Guest Authentication, that doesn’t require user authentication in order to display tweets. Since you want to combine the information, you’d want to use a Collection timeline - https://docs.fabric.io/apple/twitter/show-timelines.html#collection-timeline which can contain mixed information.


#5

The collection Timeline looks interesting and I’ll take a look at it closer. Would that still require using one of the TweetKit View Controllers? Also would it allow access to the individual tweets, specifically the JSON data?

At the very least is there a way to turn on links for hashtags & usernames in the tweets that are displayed? Currently the behavior seems to be that tweets show up in the tableview but none of the hashtags or usernames are highlighted and if you tap on a cell you are taken to a tweet detail view that seems to highlight those items.


#6

If you want to use JSON only, then you could look at this approach: https://docs.fabric.io/apple/twitter/show-tweets.html#use-static-json-for-tweets

Currently, making hashtags or usernames clickable isn’t an option, but I’ll let the team know you’d like to see it added.


#7

I did see that TWTRTweet can be initialized with JSON data though I do not know how to get JSON, or any tweet data, from TWTRCollectionTimelineDataSource, TWTRListTimelineDataSource or TWTRSearchTimelineDataSource. It would seem that even if we get the tweets that we want in one of the DataSource objects the only way to display them is in one of the TwitterKit viewControllers, is that correct? There does not appear to be any other way to get at the tweet data.