firebase / firebase-cpp-sdk

Firebase C++ SDK
http://firebase.google.com
Apache License 2.0
272 stars 113 forks source link

Need a way to list items in a storage bucket #43

Open mark-grimes opened 4 years ago

mark-grimes commented 4 years ago

Please fill in the following fields:

Pre-built SDK from the website or open-source from this repo: website, retrieved 10/Mar/2010 Firebase C++ SDK version: 6.12.0 Firebase plugins in use (Auth, Database, etc.): auth, storage Additional SDKs you are using (Facebook, AdMob, etc.): n/a Platform you are using the C++ SDK on (Mac, Windows, or Linux): Mac Platform you are targeting (iOS, Android, and/or desktop): iOS and desktop

Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

We use date-time stamps to create unique filenames, so it's very difficult to retrieve files afterwards without being able to list and iterate over the bucket contents.

All other APIs have storageRef.list() and storageRef.listAll() to list items in a storage bucket, except for C++. Getting a list of all items (rather than per "directory") would be fine, but there's currently no way to do this either.

It is possible to get some results by calling rootStorageRef.GetBytes(...)/GetFile(...), which returns a JSON listing. This isn't a full list though, because it has nextPageToken to get the next pagination but there is no way (as far as I can see) to use this token to get the next set of results in C++.

Another option would be to have the functionality to craft custom curl requests, so that missing C++ API methods could be worked around by adding things like nextPageToken into the endpoint call. If this functionality already exists I can't find it.

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase C++ quickstarts ?

Not applicable, because quickstarts doesn't exercise the requested functionality.

What's the issue repro rate? (eg 100%, 1/5 etc)

100% (missing/requested feature).

morganchen12 commented 4 years ago

For the time being a workaround is to store download URLs in Realtime Database.

ttgil commented 2 years ago

Is there any technical reason why this is still not exposed in the C++ SDK, given that it's been available in the other SDKs for 2 years? Makes a huge impact on complexity and dev effort across all projects using the C++ Storage API, so it seems like a worthwhile thing to prioritize if there's nothing blocking it.