Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Analytics custom list of values

I'm trying to use the bundle method putStringArrayList() but I'm always getting an error in firebase console.

Bundle bundle = new Bundle();

ArrayList<String> types = new ArrayList<String>();
types.add("test1");
types.add("test2");
bundle.putStringArrayList("Types", types);

mFirebaseAnalytics.logEvent("MainActivity", bundle);

In Firebase console I get this error:

error_value Types
firebase_error 4

And a link to Analytics Error Codes (Event parameter value is too long).

How I am supposed to send more than one value for a specific key?

like image 370
Nelson Almendra Avatar asked Jun 07 '17 19:06

Nelson Almendra


1 Answers

According to the API docs for logEvent, the params bundle description says

String, long and double param types are supported.

You are getting this error because the param type you're using is a map to a String array list which is not supported. Take a look at this discussion in the firebase google group.

You could instead do something like this, which would essentially be the same.

bundle.putString("Types", types.toString());
like image 85
Venkata Narayana Avatar answered Sep 17 '22 14:09

Venkata Narayana