[android][ios][storage] UploadTaskSnapshot `downloadUrl` renamed to download `downloadURL` to match web sdk. fixes #379
This commit is contained in:
parent
7ea3ae07a3
commit
f6928634f2
|
@ -496,7 +496,7 @@ public class RNFirebaseStorage extends ReactContextBaseJavaModule {
|
||||||
|
|
||||||
if (taskSnapshot != null) {
|
if (taskSnapshot != null) {
|
||||||
resp.putDouble("bytesTransferred", taskSnapshot.getBytesTransferred());
|
resp.putDouble("bytesTransferred", taskSnapshot.getBytesTransferred());
|
||||||
resp.putString("downloadUrl", taskSnapshot.getDownloadUrl() != null ? taskSnapshot.getDownloadUrl().toString() : null);
|
resp.putString("downloadURL", taskSnapshot.getDownloadUrl() != null ? taskSnapshot.getDownloadUrl().toString() : null);
|
||||||
|
|
||||||
StorageMetadata d = taskSnapshot.getMetadata();
|
StorageMetadata d = taskSnapshot.getMetadata();
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
|
|
|
@ -336,7 +336,7 @@ RCT_EXPORT_METHOD(putFile:(NSString *) appName
|
||||||
- (NSDictionary *)getUploadTaskAsDictionary:(FIRStorageTaskSnapshot *)task {
|
- (NSDictionary *)getUploadTaskAsDictionary:(FIRStorageTaskSnapshot *)task {
|
||||||
NSString *downloadUrl = [task.metadata.downloadURL absoluteString];
|
NSString *downloadUrl = [task.metadata.downloadURL absoluteString];
|
||||||
NSDictionary *metadata = [task.metadata dictionaryRepresentation];
|
NSDictionary *metadata = [task.metadata dictionaryRepresentation];
|
||||||
return @{@"bytesTransferred": @(task.progress.completedUnitCount), @"downloadUrl": downloadUrl != nil ? downloadUrl : [NSNull null], @"metadata": metadata != nil ? metadata : [NSNull null], @"ref": task.reference.fullPath, @"state": [self getTaskStatus:task.status], @"totalBytes": @(task.progress.totalUnitCount)};
|
return @{@"bytesTransferred": @(task.progress.completedUnitCount), @"downloadURL": downloadUrl != nil ? downloadUrl : [NSNull null], @"metadata": metadata != nil ? metadata : [NSNull null], @"ref": task.reference.fullPath, @"state": [self getTaskStatus:task.status], @"totalBytes": @(task.progress.totalUnitCount)};
|
||||||
}
|
}
|
||||||
|
|
||||||
- (FIRStorageMetadata *)buildMetadataFromMap:(NSDictionary *)metadata {
|
- (FIRStorageMetadata *)buildMetadataFromMap:(NSDictionary *)metadata {
|
||||||
|
|
Loading…
Reference in New Issue