flutterfire_desktop
flutterfire_desktop copied to clipboard
feat(firebase_storage): firebase storage Dart & Desktop
starting firestorage dart/desktop implementation
@pr-Mais @TimWhiting I need help in starting the api part so i can continue from there as rest api is still in beta but it is supported in firebase javascript sdk so what should i do or start with
I would look at how the javascript is accessing it: https://github.com/firebase/firebase-js-sdk/blob/master/packages/storage/src/implementation/requests.ts
Not sure I would organize it the same as the javascript, but the functions in that file seems to be the api surface I would implement in an FirebaseStorageApiClient class.
As @TimWhiting said, the JS SDK was my reference in auth, if you look at the API layer in Auth you can take inspiration. Additionally, we use the generated Firebase APIs instead of building it from scratch.
@pr-Mais @TimWhiting I have already done this but couldn't figure how to extend this by imported code from js sdk as some of functions are implemented twice with different approaches i have searched also the android firebase library so iam stuck at the start but i will try my best
I used to check the three SDKs for the same functionality (iOS, Android, and JS). There's a way each is implementing something following the practices for the language and framework, but the general idea should be the same.
You can start from the Dart API part in firebase_storage_web, then add an API layer under it, which will be in place of interop
part in the web package.
sorry for bothering you but how can i test my implementationsof any api request is correct thanks in advance for both dart /desktop packages "should i create them from scratch??"
how to get "'X-Firebase-Storage-Version'" token inside firebase app @pr-Mais @TimWhiting
Off-topic but I've just added the newly released firebasestorage:v1
api (https://github.com/invertase/dart_firebase_apis/pull/3) to https://github.com/invertase/dart_firebase_apis
@Ahmed-elshorbagy sorry for delay. Could you reference a link to where is X-Firebase-Storage-Version
mentioned?
Regarding testing, write test cases following FlutterFire tests for the Desktop package, and refer to the tests in auth for the Dart package. Also, make an example app in the Desktop package and test the functionalities you implement.
@pr-Mais https://github.com/firebase/firebase-js-sdk/blob/e34e98e73a72f77ee87d9005d6728402129deda9/packages/storage/src/implementation/request.ts#L249 this header is required form most app requests its linked to json file in app core package
I tracked it down here: https://github.com/firebase/firebase-js-sdk/blob/cdada6c68f9740d13dd6674bcb658e28e68253b6/packages/app/src/api.ts#L31-L51
So this header represents the current SDK version used by the app making the requests. On Dart, could be read from pubspec.yaml
, will see the best way to get this done for all packages, I assume they all would have such a header. For now, you can manually set a constant with the initial version number hardcoded
cloud.
+1