Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with iOS Image download failure #432

Closed
StevenMasini opened this issue Mar 20, 2019 · 1 comment
Closed

Problems with iOS Image download failure #432

StevenMasini opened this issue Mar 20, 2019 · 1 comment

Comments

@StevenMasini
Copy link

StevenMasini commented Mar 20, 2019

Hi @DylanVann

I am addressing two problems here, but with the same root cause.

Fortunately I already know how to fix these issues on iOS.
Also I checked on Android and it seems that Android auto-retry when images failed to download.

So as far as I know Android isn't affected by this problem.

Problem 1:

Image failed to download, they won't auto-retry the download and no error will be broadcasted.
The method onError is triggered but won't return the error.

I understand that it's difficult to unify Android and iOS error handling

Problem 2:

I explained on this thread #394

Let's say we have ImageCanvas1 on Page 1 who failed to download the image, then I push Page 2 with ImageCanvas2 who successfully download the picture.

When I pop back to Page 1, "ImageCanvas1" isn't aware of the download by ImageCanvas2 and is still empty.

Solution

  1. Apparently we can't only rely on the flag SDWebImageRetryFailed to auto-retry when an image download failed. We need to implement our own auto-retry mechanism. Feature Request: Add automatic download retry option SDWebImage/SDWebImage#2587

  2. We can post a notification via NSNotificationCenter to all the instance of FFFastImageView sharing the same source.url to let them know that the resource has been downloaded successfully by one of them.

I am not sure that SDWebImageRetryFailed will manage all failure scenario but for the second solution I tested it and it works perfectly.

@StevenMasini StevenMasini changed the title Two problems with iOS Image download failure Problems with iOS Image download failure Mar 20, 2019
@antitoine
Copy link

For anyone looking for a quick solution for working around using only React Native : #394 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants