DoSomethingArchive / LetsDoThis-iOS

:iphone: iOS source code for DoSomething: Take Action on the News
http://app.dosomething.org
MIT License
2 stars 0 forks source link

Cause Detail cover images fail to load on 301s #1022

Closed aaronschachter closed 8 years ago

aaronschachter commented 8 years ago

Sometimes the Cause cover images appear with the failed image on device -- haven't been able to replicate it in Simulator. Inspecting a Cause object from the API indicates that Wordpress is storing the uploaded image URL in the database, since we made the domain change in #1018:

{ cause: 
       { id: 16,
         title: 'Animals',
         tagline: 'Sometimes Simba or Bambi or Dory need your help.',
         image_url: 'http://live-ltd-news.pantheon.io/wp-content/uploads/2016/03/animals.png' },
      campaignsUrl: 'https://www.dosomething.org/api/v1/campaigns?term_ids=16&count=100',
      rootTag: 21 }

Verified that the image URL exists, but whats causing the NetworkImage react component error are redirects:

[tid:com.facebook.React.JavaScript] The operation couldn’t be completed. (NSURLErrorDomain error 301.) May 18 14:12:07 DoSomething[308] : The operation couldn’t be completed. (NSURLErrorDomain error 301.) 2016-05-18 14:12:07.600 [info][tid:com.facebook.React.JavaScript] The operation couldn’t be completed. (NSURLErrorDomain error 301.) May 18 14:12:07 DoSomething[308] : The operation couldn’t be completed. (NSURLErrorDomain error 301.)

aaronschachter commented 8 years ago

👾 https://github.com/facebook/react-native/issues/4940

lkpttn commented 8 years ago

Re-uploaded all the images so they point directly to pantheonsite.io which negates the 301s.

aaronschachter commented 8 years ago

Looks like this may be fixed in React native 0.26 -- https://github.com/facebook/react-native/releases/tag/v0.26.0

Fix images not displaying with HTTP response 301 - 192ab66