TwitterKit for Swift not displaying Images

ios
fabric
swift

#1

Issue
When loading returned Twitter JSON feed into the TwitterKit Table View Cell, the Profile Image and Media Image does not load. All other data (user name, Retweet status, description, links) loads and is shown correctly in the twitterTableView, but the images do not.

The JSON feed contains accurate image URL’s.

Has anyone experienced this, or have a solution that allows for a nested Twitter table inside a View Controller?

Version Info
Xcode v7.0.1
Code Base: Swift 2.0
App Compatibility iOS 8.3+
TwitterCore v1.12.0
TwitterKit v1.12.0

ViewController in Storyboard

  • ViewController
  • ScrollView
    • InfoView (for other info)
    • SocialView (for info on the Twitter Profile, and Twitter Feed)
      • ProfileInfoView
      • twitterTable (no assigned class, with ViewController as datasource & delegate)
        • twitterTableViewCell (assigned TWTRTweetTableViewCell class)

Metadata Workflow

  1. App calls Proprietary Server API
  2. Server either:
    2.a. Return cached Twitter JSON
    2.b. Call Twitter API with search term. Cache Twitter JSON response. Return Twitter JSON.
  3. App parses JSON, and utilizes TWTRTweet.tweetsWithJSONArray to set var tweets
  4. On tweets set, update twitterTable with tweets

Relevant Code in the ViewController


import UIKit
import Alamofire
import SwiftyJSON
import RealmSwift
import TwitterKit

class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UICollectionViewDataSource, UICollectionViewDelegate, TWTRTweetViewDelegate {
@IBOutlet weak var socialView: UIView!
@IBOutlet weak var friendCollectionView: UICollectionView!
@IBOutlet weak var twitterTableView: UITableView!

@IBOutlet weak var friendColletionViewHeightConstraint: NSLayoutConstraint!
@IBOutlet weak var twitterTableViewHeightConstraint: NSLayoutConstraint!


var tweets: [TWTRTweet] = [] {
    didSet {
        twitterTableView.reloadData()
    }
}
var tweetHeights:[Int:CGFloat] = [:]

var isLoadingTweets = false
let tweetTableCellReuseIdentifier = "TweetCell"
var prototypeCell: TWTRTweetTableViewCell?

var isLoadingFriend = false
var friends:[Friend] = [] {
    didSet {
        friendCollectionView.reloadData()
    }
}

override func viewDidLoad() {
    super.viewDidLoad()        

    self.loadInfo()
    self.loadFriends()
    self.loadTweets()

    // Create a single prototype cell for height calculations.
    self.prototypeCell = TWTRTweetTableViewCell(style: .Default, reuseIdentifier: tweetTableCellReuseIdentifier)

    // Register the identifier for TWTRTweetTableViewCell.
    self.twitterTableView.registerClass(TWTRTweetTableViewCell.self, forCellReuseIdentifier: tweetTableCellReuseIdentifier)
}

func loadInfo(){
    print("loads basic info")
    // code removed to simplify post
}

func loadFriends(){
    print("loads friendsCollectionView inside Info")
    // code removed to simplify post
}

func loadTweets(){
    print("loadTweets")
    // Do not trigger another request if one is already in progress.
    if self.isLoadingTweets {
        return
    }
    self.isLoadingTweets = true

    Alamofire.request(APIService.Router.TwitterSearch(searchType: "hashtag", searchTerm: "something", userSocialProfileID: ""))
        .responseString { response in
            print("request: \(response.0!)")
            print("\n*******loadTweets********\n\n\(response.2.value!)\n\n**************\n")
        }
        .responseJSON { response in
            // print("\n*******loadTweets:JSON********\n\n\(response.2.value!)\n\n**************\n")

            if let json = response.2.value {
                var jsonObj = JSON(json)

                if let results = jsonObj["results"].dictionary{
                    if let jsonTweets = results["statuses"]!.arrayObject {
                        // print("The tweets are \n\(jsonTweets)")
                        self.tweets = TWTRTweet.tweetsWithJSONArray(jsonTweets) as! [TWTRTweet]
                    } else {
                        print("jsonTweets are not an array of Objects")
                    }
                } else {
                    print("Results is not a dictionary.")
                }

                dispatch_async(dispatch_get_main_queue(),{
                    self.twitterTableViewHeightConstraint.constant = 0
                    for (_, tweetHeight) in self.tweetHeights {
                        self.twitterTableViewHeightConstraint.constant += tweetHeight
                    }
                    self.isLoadingTweets = false
                })

            } else {
                print("value was not json...or something is wrong with the code")
            }
    }

}

//MARK: UITABLEVIEW
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return tweets.count
}

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
    let tweet = self.tweets[indexPath.row] as TWTRTweet!
    if tweets.count > indexPath.row {
        prototypeCell?.configureWithTweet(tweet)
    }

    let tweetHeight = TWTRTweetTableViewCell.heightForTweet(tweet, width: tableView.bounds.width)

    self.tweetHeights[indexPath.row] = tweetHeight
    return tweetHeight
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier(tweetTableCellReuseIdentifier, forIndexPath: indexPath) as! TWTRTweetTableViewCell

    // Assign the delegate to control events on Tweets.
    cell.tweetView.delegate = self

    cell.tweetView.showActionButtons = false
    cell.tweetView.linkTextColor = UIColor().cosMediumPurple()

    // Retrieve the Tweet model from loaded Tweets.
    let tweet = tweets[indexPath.row] as TWTRTweet!

    // Configure the cell with the Tweet.
    cell.configureWithTweet(tweet)

    // Return the Tweet cell.
    return cell
}
}

#2

Hey there,

I haven’t seen this happen in my local testing. Here are two sample apps that may help out - Swift and Obj-C.

Let me know if that helps or if you have any other questions.

-Mike


#3

Hi Mike, thank you for your quick response. I checked the Swift app out, and it seems the major difference is that Cannonball is using the Client to retrieve the Twitter JSON feed, whereas, our app is doing so from our server (for caching and authentication).

Also, I wanted to confirm, that NSAllowsArbitraryLoads is set to YES. So the URL should not be blocked.

Could the feed we’re receiving be causing the issue? TwitterKit is able to read all of the text correctly, but maybe it’s not pulling the correct key for the images. Here is a sample of the feed were are receiving from our Server API call.

{
   "results":{
      "statuses":[
         {
            "metadata":{
               "iso_language_code":"en",
               "result_type":"recent"
            },
            "created_at":"Fri Oct 30 19:02:18 +0000 2015",
            "id":660169876129112064,
            "id_str":"660169876129112064",
            "text":"RT @Matt_Alt: Halloween in Tokyo: The rent-a-cop at Shibuya station holding a bilingual sign saying \"please refrain from cosplay changes in…",
            "source":"<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
            "truncated":false,
            "in_reply_to_status_id":null,
            "in_reply_to_status_id_str":null,
            "in_reply_to_user_id":null,
            "in_reply_to_user_id_str":null,
            "in_reply_to_screen_name":null,
            "user":{
               "id":379045183,
               "id_str":"379045183",
               "name":"Mech",
               "screen_name":"MechWarriorNY",
               "location":"",
               "description":"",
               "url":null,
               "entities":{
                  "description":{
                     "urls":[

                     ]
                  }
               },
               "protected":false,
               "followers_count":791,
               "friends_count":1973,
               "listed_count":40,
               "created_at":"Sat Sep 24 08:12:42 +0000 2011",
               "favourites_count":110975,
               "utc_offset":-14400,
               "time_zone":"Eastern Time (US & Canada)",
               "geo_enabled":true,
               "verified":false,
               "statuses_count":73745,
               "lang":"en",
               "contributors_enabled":false,
               "is_translator":false,
               "is_translation_enabled":false,
               "profile_background_color":"89C9FA",
               "profile_background_image_url":"http://pbs.twimg.com/profile_background_images/546289009916260352/gm04-lCc.jpeg",
               "profile_background_image_url_https":"https://pbs.twimg.com/profile_background_images/546289009916260352/gm04-lCc.jpeg",
               "profile_background_tile":false,
               "profile_image_url":"http://pbs.twimg.com/profile_images/587019455185620992/5fjSpil6_normal.jpg",
               "profile_image_url_https":"https://pbs.twimg.com/profile_images/587019455185620992/5fjSpil6_normal.jpg",
               "profile_banner_url":"https://pbs.twimg.com/profile_banners/379045183/1428292013",
               "profile_link_color":"3B94D9",
               "profile_sidebar_border_color":"FFFFFF",
               "profile_sidebar_fill_color":"DAECF4",
               "profile_text_color":"663B12",
               "profile_use_background_image":true,
               "has_extended_profile":false,
               "default_profile":false,
               "default_profile_image":false,
               "following":false,
               "follow_request_sent":false,
               "notifications":false
            },
            "geo":null,
            "coordinates":null,
            "place":null,
            "contributors":null,
            "retweeted_status":{
               "metadata":{
                  "iso_language_code":"en",
                  "result_type":"recent"
               },
               "created_at":"Fri Oct 30 13:01:09 +0000 2015",
               "id":660078991731109888,
               "id_str":"660078991731109888",
               "text":"Halloween in Tokyo: The rent-a-cop at Shibuya station holding a bilingual sign saying \"please refrain from cosplay changes in the bathroom\"",
               "source":"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>",
               "truncated":false,
               "in_reply_to_status_id":null,
               "in_reply_to_status_id_str":null,
               "in_reply_to_user_id":null,
               "in_reply_to_user_id_str":null,
               "in_reply_to_screen_name":null,
               "user":{
                  "id":15816424,
                  "id_str":"15816424",
                  "name":"Matt Alt",
                  "screen_name":"Matt_Alt",
                  "location":"Tokyo",
                  "description":"Co-founder of AltJapan Co., Ltd.  http://t.co/uStQHcQab1 We produce English versions of Japanese games, manga, & other stuff. Co-author of Yokai Attack!",
                  "url":"http://t.co/a9YuyswIJE",
                  "entities":{
                     "url":{
                        "urls":[
                           {
                              "url":"http://t.co/a9YuyswIJE",
                              "expanded_url":"http://www.amazon.com/Matt-Alt/e/B001JOQTHY/ref=ntt_athr_dp_pel_2",
                              "display_url":"amazon.com/Matt-Alt/e/B00…",
                              "indices":[
                                 0,
                                 22
                              ]
                           }
                        ]
                     },
                     "description":{
                        "urls":[
                           {
                              "url":"http://t.co/uStQHcQab1",
                              "expanded_url":"http://www.altjapan.com",
                              "display_url":"altjapan.com",
                              "indices":[
                                 34,
                                 56
                              ]
                           }
                        ]
                     }
                  },
                  "protected":false,
                  "followers_count":7648,
                  "friends_count":654,
                  "listed_count":590,
                  "created_at":"Tue Aug 12 00:52:44 +0000 2008",
                  "favourites_count":581,
                  "utc_offset":-36000,
                  "time_zone":"Hawaii",
                  "geo_enabled":false,
                  "verified":false,
                  "statuses_count":8619,
                  "lang":"en",
                  "contributors_enabled":false,
                  "is_translator":false,
                  "is_translation_enabled":false,
                  "profile_background_color":"9AE4E8",
                  "profile_background_image_url":"http://pbs.twimg.com/profile_background_images/2867495/frog_firebelly.jpg",
                  "profile_background_image_url_https":"https://pbs.twimg.com/profile_background_images/2867495/frog_firebelly.jpg",
                  "profile_background_tile":true,
                  "profile_image_url":"http://pbs.twimg.com/profile_images/58093128/sirgoodhead_normal.jpg",
                  "profile_image_url_https":"https://pbs.twimg.com/profile_images/58093128/sirgoodhead_normal.jpg",
                  "profile_banner_url":"https://pbs.twimg.com/profile_banners/15816424/1443427123",
                  "profile_link_color":"0000FF",
                  "profile_sidebar_border_color":"87BC44",
                  "profile_sidebar_fill_color":"E0FF92",
                  "profile_text_color":"000000",
                  "profile_use_background_image":true,
                  "has_extended_profile":false,
                  "default_profile":false,
                  "default_profile_image":false,
                  "following":false,
                  "follow_request_sent":false,
                  "notifications":false
               },
               "geo":null,
               "coordinates":null,
               "place":null,
               "contributors":null,
               "is_quote_status":false,
               "retweet_count":26,
               "favorite_count":37,
               "entities":{
                  "hashtags":[

                  ],
                  "symbols":[

                  ],
                  "user_mentions":[

                  ],
                  "urls":[

                  ]
               },
               "favorited":false,
               "retweeted":false,
               "lang":"en"
            },
            "is_quote_status":false,
            "retweet_count":26,
            "favorite_count":0,
            "entities":{
               "hashtags":[

               ],
               "symbols":[

               ],
               "user_mentions":[
                  {
                     "screen_name":"Matt_Alt",
                     "name":"Matt Alt",
                     "id":15816424,
                     "id_str":"15816424",
                     "indices":[
                        3,
                        12
                     ]
                  }
               ],
               "urls":[

               ]
            },
            "favorited":false,
            "retweeted":false,
            "lang":"en"
         },
         {
            "metadata":{
               "iso_language_code":"en",
               "result_type":"recent"
            },
            "created_at":"Fri Oct 30 19:02:13 +0000 2015",
            "id":660169855899992064,
            "id_str":"660169855899992064",
            "text":"RT @LDShadowLady: I liked a @YouTube video from @ihascupquake https://t.co/2FrdMGJiaX Fran Bow - Cosplay",
            "source":"<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
            "truncated":false,
            "in_reply_to_status_id":null,
            "in_reply_to_status_id_str":null,
            "in_reply_to_user_id":null,
            "in_reply_to_user_id_str":null,
            "in_reply_to_screen_name":null,
            "user":{
               "id":2865286754,
               "id_str":"2865286754",
               "name":"Kimi-",
               "screen_name":"lilibib",
               "location":"",
               "description":"",
               "url":null,
               "entities":{
                  "description":{
                     "urls":[

                     ]
                  }
               },
               "protected":false,
               "followers_count":69,
               "friends_count":56,
               "listed_count":0,
               "created_at":"Sun Oct 19 15:44:42 +0000 2014",
               "favourites_count":2839,
               "utc_offset":null,
               "time_zone":null,
               "geo_enabled":true,
               "verified":false,
               "statuses_count":2716,
               "lang":"de",
               "contributors_enabled":false,
               "is_translator":false,
               "is_translation_enabled":false,
               "profile_background_color":"C0DEED",
               "profile_background_image_url":"http://abs.twimg.com/images/themes/theme1/bg.png",
               "profile_background_image_url_https":"https://abs.twimg.com/images/themes/theme1/bg.png",
               "profile_background_tile":false,
               "profile_image_url":"http://pbs.twimg.com/profile_images/652774860083621889/38uPnMzI_normal.jpg",
               "profile_image_url_https":"https://pbs.twimg.com/profile_images/652774860083621889/38uPnMzI_normal.jpg",
               "profile_link_color":"0084B4",
               "profile_sidebar_border_color":"C0DEED",
               "profile_sidebar_fill_color":"DDEEF6",
               "profile_text_color":"333333",
               "profile_use_background_image":true,
               "has_extended_profile":false,
               "default_profile":true,
               "default_profile_image":false,
               "following":false,
               "follow_request_sent":false,
               "notifications":false
            },
            "geo":null,
            "coordinates":null,
            "place":null,
            "contributors":null,
            "retweeted_status":{
               "metadata":{
                  "iso_language_code":"en",
                  "result_type":"recent"
               },
               "created_at":"Fri Oct 30 16:43:56 +0000 2015",
               "id":660135055017320453,
               "id_str":"660135055017320453",
               "text":"I liked a @YouTube video from @ihascupquake https://t.co/2FrdMGJiaX Fran Bow - Cosplay",
               "source":"<a href=\"http://www.google.com/\" rel=\"nofollow\">Google</a>",
               "truncated":false,
               "in_reply_to_status_id":null,
               "in_reply_to_status_id_str":null,
               "in_reply_to_user_id":null,
               "in_reply_to_user_id_str":null,
               "in_reply_to_screen_name":null,
               "user":{
                  "id":258140881,
                  "id_str":"258140881",
                  "name":"LDSpookyLady",
                  "screen_name":"LDShadowLady",
                  "location":"Stormwind",
                  "description":"Lizzie. 23 year old YouTube Gamer and Cat-Lover... @Smallishbeans is my player 2. Instagram: LDShadowLady",
                  "url":"http://t.co/ypWtNXAAmv",
                  "entities":{
                     "url":{
                        "urls":[
                           {
                              "url":"http://t.co/ypWtNXAAmv",
                              "expanded_url":"http://www.youtube.com/ldshadowlady",
                              "display_url":"youtube.com/ldshadowlady",
                              "indices":[
                                 0,
                                 22
                              ]
                           }
                        ]
                     },
                     "description":{
                        "urls":[

                        ]
                     }
                  },
                  "protected":false,
                  "followers_count":244258,
                  "friends_count":1214,
                  "listed_count":450,
                  "created_at":"Sun Feb 27 01:58:36 +0000 2011",
                  "favourites_count":8138,
                  "utc_offset":0,
                  "time_zone":"London",
                  "geo_enabled":false,
                  "verified":true,
                  "statuses_count":48322,
                  "lang":"en",
                  "contributors_enabled":false,
                  "is_translator":false,
                  "is_translation_enabled":false,
                  "profile_background_color":"9AE4E8",
                  "profile_background_image_url":"http://pbs.twimg.com/profile_background_images/769072891/2018a8fc2b63a050485119b16e1ce706.png",
                  "profile_background_image_url_https":"https://pbs.twimg.com/profile_background_images/769072891/2018a8fc2b63a050485119b16e1ce706.png",
                  "profile_background_tile":true,
                  "profile_image_url":"http://pbs.twimg.com/profile_images/580358349675352064/hpZ6zXFH_normal.jpg",
                  "profile_image_url_https":"https://pbs.twimg.com/profile_images/580358349675352064/hpZ6zXFH_normal.jpg",
                  "profile_banner_url":"https://pbs.twimg.com/profile_banners/258140881/1433872408",
                  "profile_link_color":"0084B4",
                  "profile_sidebar_border_color":"FFFFFF",
                  "profile_sidebar_fill_color":"DDFFCC",
                  "profile_text_color":"333333",
                  "profile_use_background_image":true,
                  "has_extended_profile":true,
                  "default_profile":false,
                  "default_profile_image":false,
                  "following":false,
                  "follow_request_sent":false,
                  "notifications":false
               },
               "geo":null,
               "coordinates":null,
               "place":null,
               "contributors":null,
               "is_quote_status":false,
               "retweet_count":24,
               "favorite_count":205,
               "entities":{
                  "hashtags":[

                  ],
                  "symbols":[

                  ],
                  "user_mentions":[
                     {
                        "screen_name":"YouTube",
                        "name":"YouTube",
                        "id":10228272,
                        "id_str":"10228272",
                        "indices":[
                           10,
                           18
                        ]
                     },
                     {
                        "screen_name":"iHasCupquake",
                        "name":"☾Cupquake ♡",
                        "id":186888760,
                        "id_str":"186888760",
                        "indices":[
                           30,
                           43
                        ]
                     }
                  ],
                  "urls":[
                     {
                        "url":"https://t.co/2FrdMGJiaX",
                        "expanded_url":"http://youtu.be/uquaeUYqhZk?a",
                        "display_url":"youtu.be/uquaeUYqhZk?a",
                        "indices":[
                           44,
                           67
                        ]
                     }
                  ]
               },
               "favorited":false,
               "retweeted":false,
               "possibly_sensitive":false,
               "lang":"en"
            },
            "is_quote_status":false,
            "retweet_count":24,
            "favorite_count":0,
            "entities":{
               "hashtags":[

               ],
               "symbols":[

               ],
               "user_mentions":[
                  {
                     "screen_name":"LDShadowLady",
                     "name":"LDSpookyLady",
                     "id":258140881,
                     "id_str":"258140881",
                     "indices":[
                        3,
                        16
                     ]
                  },
                  {
                     "screen_name":"YouTube",
                     "name":"YouTube",
                     "id":10228272,
                     "id_str":"10228272",
                     "indices":[
                        28,
                        36
                     ]
                  },
                  {
                     "screen_name":"iHasCupquake",
                     "name":"☾Cupquake ♡",
                     "id":186888760,
                     "id_str":"186888760",
                     "indices":[
                        48,
                        61
                     ]
                  }
               ],
               "urls":[
                  {
                     "url":"https://t.co/2FrdMGJiaX",
                     "expanded_url":"http://youtu.be/uquaeUYqhZk?a",
                     "display_url":"youtu.be/uquaeUYqhZk?a",
                     "indices":[
                        62,
                        85
                     ]
                  }
               ]
            },
            "favorited":false,
            "retweeted":false,
            "possibly_sensitive":false,
            "lang":"en"
         }
    ],
      "search_metadata":{
         "completed_in":0.05,
         "max_id":660169876129112064,
         "max_id_str":"660169876129112064",
         "next_results":"?max_id=660168832003276800&q=from%253Acosplay%2520OR%2520%2540cosplay&include_entities=1",
         "query":"from%253Acosplay%2520OR%2520%2540cosplay",
         "refresh_url":"?since_id=660169876129112064&q=from%253Acosplay%2520OR%2520%2540cosplay&include_entities=1",
         "count":15,
         "since_id":0,
         "since_id_str":"0"
      }
   }
}

#4

None of those tweet entities in your JSON seem to have a media key? Was that intentional?

I would have anticipated JSON that looked a little more like this:

{
 "created_at": "Wed Nov 07 04:16:18 +0000 2012",
 "id": 266031293945503744,
 "id_str": "266031293945503744",
 "text": "Four more years. http:\/\/t.co\/bAJE6Vom",
 "source": "\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e",
 "truncated": false,
 "in_reply_to_status_id": null,
 "in_reply_to_status_id_str": null,
 "in_reply_to_user_id": null,
 "in_reply_to_user_id_str": null,
 "in_reply_to_screen_name": null,
 "user": {
   "id": 813286,
   "id_str": "813286",
   "name": "Barack Obama",
   "screen_name": "BarackObama",
   "location": "Washington, DC",
   "description": "This account is run by Organizing for Action staff. Tweets from the President are signed -bo.",
   "url": "http:\/\/t.co\/O5Woad92z1",
   "entities": {
 "url": {
 "urls": [{
          "url": "http:\/\/t.co\/O5Woad92z1",
          "expanded_url": "http:\/\/www.barackobama.com",
          "display_url": "barackobama.com",
          "indices": [0, 22]
          }]
 },
 "description": {
 "urls": []
 }
   },
   "protected": false,
   "followers_count": 65774564,
   "friends_count": 639293,
   "listed_count": 213215,
   "created_at": "Mon Mar 05 22:08:25 +0000 2007",
   "favourites_count": 9,
   "utc_offset": -18000,
   "time_zone": "Eastern Time (US & Canada)",
   "geo_enabled": false,
   "verified": true,
   "statuses_count": 14245,
   "lang": "en",
   "contributors_enabled": false,
   "is_translator": false,
   "is_translation_enabled": true,
   "profile_background_color": "77B0DC",
   "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/451819093436268544\/kLbRvwBg.png",
   "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/451819093436268544\/kLbRvwBg.png",
   "profile_background_tile": false,
   "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/451007105391022080\/iu1f7brY_normal.png",
   "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/451007105391022080\/iu1f7brY_normal.png",
   "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/813286\/1415570989",
   "profile_link_color": "2574AD",
   "profile_sidebar_border_color": "FFFFFF",
   "profile_sidebar_fill_color": "C2E0F6",
   "profile_text_color": "333333",
   "profile_use_background_image": true,
   "has_extended_profile": true,
   "default_profile": false,
   "default_profile_image": false,
   "following": null,
   "follow_request_sent": null,
   "notifications": null
 },
 "geo": null,
 "coordinates": null,
 "place": null,
 "contributors": null,
 "is_quote_status": false,
 "retweet_count": 742891,
 "favorite_count": 290344,
 "entities": {
   "hashtags": [],
   "symbols": [],
   "user_mentions": [],
   "urls": [],
   "media": [{
                 "id": 266031293949698048,
                 "id_str": "266031293949698048",
                 "indices": [17, 37],
                 "media_url": "http:\/\/pbs.twimg.com\/media\/A7EiDWcCYAAZT1D.jpg",
                 "media_url_https": "https:\/\/pbs.twimg.com\/media\/A7EiDWcCYAAZT1D.jpg",
                 "url": "http:\/\/t.co\/bAJE6Vom",
                 "display_url": "pic.twitter.com\/bAJE6Vom",
                 "expanded_url": "http:\/\/twitter.com\/BarackObama\/status\/266031293945503744\/photo\/1",
                 "type": "photo",
                 "sizes": {
                 "medium": {
                 "w": 600,
                 "h": 399,
                 "resize": "fit"
                 },
                 "small": {
                 "w": 340,
                 "h": 226,
                 "resize": "fit"
                 },
                 "thumb": {
                 "w": 150,
                 "h": 150,
                 "resize": "crop"
                 },
                 "large": {
                 "w": 800,
                 "h": 532,
                 "resize": "fit"
                 }
                 }
                 }]
 },
 "extended_entities": {
   "media": [{
                 "id": 266031293949698048,
                 "id_str": "266031293949698048",
                 "indices": [17, 37],
                 "media_url": "http:\/\/pbs.twimg.com\/media\/A7EiDWcCYAAZT1D.jpg",
                 "media_url_https": "https:\/\/pbs.twimg.com\/media\/A7EiDWcCYAAZT1D.jpg",
                 "url": "http:\/\/t.co\/bAJE6Vom",
                 "display_url": "pic.twitter.com\/bAJE6Vom",
                 "expanded_url": "http:\/\/twitter.com\/BarackObama\/status\/266031293945503744\/photo\/1",
                 "type": "photo",
                 "sizes": {
                 "medium": {
                 "w": 600,
                 "h": 399,
                 "resize": "fit"
                 },
                 "small": {
                 "w": 340,
                 "h": 226,
                 "resize": "fit"
                 },
                 "thumb": {
                 "w": 150,
                 "h": 150,
                 "resize": "crop"
                 },
                 "large": {
                 "w": 800,
                 "h": 532,
                 "resize": "fit"
                 }
                 }
                 }]
 },
 "favorited": true,
 "retweeted": false,
 "possibly_sensitive": false,
 "lang": "en"
 }

Also, just wanted to give you kudos for an excellent bug report. Version numbers, sample code, ATS bypass details, etc.


#5

Hi Steven,

Thank you for the JSON feed example, and the kind words on the bug report. I realized I had shared two Twitter items that were missing the Media entities (face palm). However, that allowed me to confirm that the JSON feeds were actually the same format.

And that led me back into the Swift code to figure out the issue: I did not enter

Twitter.sharedInstance().startWithConsumerKey(“app_key”, consumerSecret: “app_secret”)

into the AppDelegate.swift file. I thought that was only necessary for API calls, but looking over the documentation again, I had a hunch it may be required for loading images. And now, the images are loading, and they look great! We’re one step closer to launching now.

I appreciate you and Mike taking the time to help troubleshoot this; unfortunately, my own assumptions got in the way. Have a great day.


#6