-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[Firebase Storage] getDownloadURL return type #1280
Comments
Hi @awhitford |
Please reopen. I don't understand why the return type is not well documented. The implementation would have two tiny changes: /// Asynchronously retrieves a long lived download URL with a revokable token.
/// This can be used to share the file with others, but can be revoked by a
/// developer in the Firebase Console if desired.
Future<String> getDownloadURL() async {
return await FirebaseStorage.channel.invokeMethod<String>(
"StorageReference#getDownloadUrl", <String, String>{
'app': _firebaseStorage.app?.name,
'bucket': _firebaseStorage.storageBucket,
'path': _pathComponents.join("/"),
});
} Note that the Java API has a return type is a The Swift API seems to indicate that maybe the return value is either a URL (success) or an Error -- so then wouldn't a If dynamic is appropriate because the return type may be String or something else, the developer needs to know to handle it appropriately. Right now, I am assuming that I am getting a String, but I don't like to assume. |
I appreciate the thumbs up support. This looks like a trivial fix; I'm surprised that this is still outstanding. Is there a way that I can help with a pull request? |
On the latest release getDownloadURL does return |
Why is the return type for getDownloadURL a dynamic instead of a String?
In practice, the runtimeType seems to be String. Could it be something else?
The text was updated successfully, but these errors were encountered: