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_analytics] cannot set default parameter due to invalid type #9698
Comments
Thanks for the report @kkoken |
@darshankawar Should I include |
@darshankawar without |
Thanks for the details. Using it, I am getting same behavior on Android as reported. /cc @russellwheatley |
@darshankawar @russellwheatley It appears to be Method Explanation: public void setDefaultEventParameters (Bundle parameters)
Adds parameters that will be set on every event logged from the SDK, including automatic ones. The values passed in the parameters bundle will be added to the map of default event parameters. These parameters persist across app runs. They are of lower precedence than event parameters, so if an event parameter and a parameter set using this API have the same name, the value of the event parameter will be used. The same limitations on event parameters apply to default event parameters.
Parameters
parameters
Parameters to be added to the map of parameters added to every event. They will be added to the map of default event parameters, replacing any existing parameter with the same name. **Valid parameter values are String, long, and double.** Setting a key's value to null will clear that parameter. Passing in a null bundle will clear all parameters. Valid parameter values are String, long, and double. |
That is correct. The plugin is wrapper around native Firebase SDK and leverages what is provided by Android Firebase SDK, so this may not be an actual issue as |
Since the flutter side accepts any object(primitive types), should not the flutter side warn us? or should not the types be limited to those three? If I have not to look the detail of the actual method, I would not have figured that out. Then, I need to ask another question about that. Why the iOS accept the bool type? One platform accepts and the other does not. It looks weird when we think of Flutter's perspective |
In relation to iOS accepting booleans. are you sure that is true? See docs: https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Classes/FIRAnalytics#+setdefaulteventparameters: Quote:
Then read the event parameters documentation: https://firebase.google.com/docs/reference/ios/firebaseanalytics/api/reference/Classes/FIRAnalytics#+logeventwithname:parameters: Quote:
|
We checked the firebase events on Could swift/objc parse bool as int? |
@kkoken What type is it appearing as on BigQuery? We actually pass the values straight to If you check Flutter docs, a boolean passed over the method channel to obj-c implementation is parsed as |
We were sending as bool for both clients. Ios was appearing on BigQuery and android was not. Thats why I only reported android. I will talk again with the analytic team to send the previous output and get back to you with outputs. |
@kkoken sorry, my question wasn't worded correctly. I know you're sending the value as a boolean. I want to know if it appears as a boolean on BigQuery? I'm wondering if the Firebase iOS SDK is reading the value as a number and sending it along as a number to Analytic's server. Or, maybe it doesn't type check for boolean as might be the case for android, and that is why you're able to get a boolean in BgQuery 🤔 |
@russellwheatley I am very sorry for the late response. I talked with the analytic team, and they said they saw the data as the parameters' values are shown as (isFree = isPremium, pushOptIn = optIn, isGranted = iysPermitted) |
@russellwheatley any news? I can offer my help on this matter. |
Hey @kkoken, we're waiting for confirmation from the Analytic's team. However, all signs indicate that the values accepted are string, int, and double parameter types. Once we have the green light, we will be strongly typing the inputs accepted for default event parameters and custom events which will be updated in this PR. I'd recommend following the documentation if you don't want unexpected results. |
Thank you very much for your answer. I am looking forward to checking the changes in the documentation. |
We have updated the In a nutshell; default parameters can only have the value |
Bug report
Describe the bug
Cannot set Default parameter to firebase analytics using
firebaseAnalytics.setDefaultEventParameters
.It gives me an error of invalid default event parameter type and only happens in Android.
Steps to reproduce
Test device -> Xiaomi Mi 9T(or K20) (Android 11)
Expected behavior
To be able to set the default parameters to all events.
Sample project
https://github.com/kaankoken/firebase-analytic-error-flutter-exp
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: