|
18 | 18 | #import "FirebaseStorageUI/Sources/Public/FirebaseStorageUI/FIRStorageDownloadTask+SDWebImage.h"
|
19 | 19 |
|
20 | 20 | #import <FirebaseCore/FirebaseCore.h>
|
21 |
| -#import <FirebaseStorage/FirebaseStorage.h> |
| 21 | +#if __has_include(<FirebaseStorage/FirebaseStorage.h>) |
| 22 | + // Firebase 8.x |
| 23 | + #import <FirebaseStorage/FirebaseStorage.h> |
| 24 | +#else |
| 25 | + // Firebase 9.0+ |
| 26 | + #import <FirebaseStorage/FirebaseStorage-Swift.h> |
| 27 | +#endif |
22 | 28 |
|
23 | 29 | #if SWIFT_PACKAGE
|
24 | 30 | @import GTMSessionFetcherCore;
|
@@ -120,7 +126,7 @@ - (BOOL)canRequestImageForURL:(NSURL *)url {
|
120 | 126 | [download observeStatus:FIRStorageTaskStatusProgress handler:^(FIRStorageTaskSnapshot * _Nonnull snapshot) {
|
121 | 127 | // Check progressive decoding if need
|
122 | 128 | if (options & SDWebImageProgressiveLoad) {
|
123 |
| - FIRStorageDownloadTask *task = snapshot.task; |
| 129 | + FIRStorageDownloadTask *task = (FIRStorageDownloadTask *)snapshot.task; |
124 | 130 | // Currently, FIRStorageDownloadTask does not have the API to grab partial data
|
125 | 131 | // But since FirebaseUI and Firebase are seamless component, we access the internal fetcher here
|
126 | 132 | GTMSessionFetcher *fetcher = task.fetcher;
|
@@ -160,7 +166,7 @@ - (BOOL)canRequestImageForURL:(NSURL *)url {
|
160 | 166 | }
|
161 | 167 |
|
162 | 168 | - (BOOL)shouldBlockFailedURLWithURL:(NSURL *)url error:(NSError *)error {
|
163 |
| - if ([error.domain isEqualToString:FIRStorageErrorDomain]) { |
| 169 | + if ([error.domain isEqualToString:@"FIRStorageErrorDomain"]) { |
164 | 170 | if (error.code == FIRStorageErrorCodeBucketNotFound
|
165 | 171 | || error.code == FIRStorageErrorCodeProjectNotFound
|
166 | 172 | || error.code == FIRStorageErrorCodeObjectNotFound) {
|
|
0 commit comments