Open nomaam opened 3 years ago
any help here
That is a limitation of the Firebase API framework you use. Firebase delivers a map of string keys with string values, and plugin itself decodes the value 'actions' key as JSONArray.
So you need to figure out how to encode an array of objects into a string in language you use on server side, and put the resulting string as the actions parameter.
If the example above is PHP, that would be probably something like this (untested) :
$data = [
'title' => $title,
'body' => $body,
"ledColor" => json_encode([0, 0, 255, 0]),
'actions' => json_encode([
'title' => "test",
'callback' => 'test',
'foreground' => "true"
])
];
$message = CloudMessage::withTarget('token', $deviceToken)
->withData($data);
did json_encode them, and it sounds to be working now with the mobile dev. thanks a lot.
error
How do I include an array of values for "actions" and "ledcolor" as it will only accept a one dimension array?