-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat(firebase_remote_config): Firebase Remote Config for Dart and Desktop #71
base: main
Are you sure you want to change the base?
Conversation
- implement desktop interface
I have worked around the installations limitation for now by hardcoding an app instance id. It is working in the example app. It turns out that the firebaseapis does not work as expected. At one point I was getting 404 errors and at one point I was getting auth errors if I remember correctly. Maybe an authenticated client is required? However, the javascript sdk does not use the same api that is generated in firebaseapis, and does not require client authentication other than the project's apiKey. Therefore, I have implemented it in that way to get an initial prototype example working. Edit: I was looking at the wrong endpoint in the firebaseapis remote config library, and probably was not providing the right parameters in the right format. |
The support for macOS is removed, it's already in official FlutterFire.
…e same app is initialized twice
@pr-Mais As installations would be helpful for this and other plugins. I'm willing to work on that next, I know you mentioned that you might work on it, but I don't know if you ever started, and I don't want to replicate work if you are already working on it. It should be a pretty quick one like this. |
I just realized I was using the firebaseapis package wrong. I'm going to give that approach another try. |
@visibleForTesting | ||
FirebaseRemoteConfig({ | ||
required this.app, | ||
this.namespace = 'firebase', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the namespace is used for? couldn't find it in the other plugins
packages/firebase_remote_config/firebase_remote_config_dart/lib/src/internal/api.dart
Outdated
Show resolved
Hide resolved
part of '../../firebase_remote_config_dart.dart'; | ||
|
||
@visibleForTesting | ||
class RemoteConfigApiClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Auth, I made sure that the API client class is separate from the package class, so it won't be part of
, and the API class on itself is a library. I did it this way cause I wanted to make sure that API internals stay hidden and I don't use its types outside accidentally (in the Desktop package), and control the visibility for package users. Check here, maybe we try to follow the same design?
Regarding installations, if I start it will open a draft PR immediately, so if you don't see it feel free to start it, I'm currently writing additional tests for Functions. Once you switch to firebaseapis we can merge right away. |
Hey @TimWhiting, wanna let you know that I started working on Installations and will push the PR soon. |
@pr-Mais Here is a diff between the two approaches. Looking into the firebaseapis it seems as though the generated dart apis use camelCase instead of snake_case for the request body. Additionally the js-sdk (which is where I got the working approach from) puts the apiKey in the queryParameters instead of the request body. I've tried a bunch of variations of the key in the request body, and could not get it to work. The example in the firebaseapis package gets a client from application default credentials which only works in a server environment and is not meant for client side applications from what I think I've read. |
Hmmm.. not sure. Have you tried using import 'package:googleapis_auth/auth_io.dart';
import 'package:firebaseapis/firebaseremoteconfig/v1.dart' as rc;
_client = client ?? clientViaApiKey(apiConfig.apiKey);
final rcApi = rc.FirebaseRemoteConfigApi(_client); |
WIP
Still some more work I can do, but ultimately blocked on installations.