Closed fuj1w4r4 closed 6 years ago
The attributes you use must be fields which are supported by the API https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages
For example:
addAttribute("title",
applicationName)
is the same as
title(applicationName).
The addAttribute methods exist in case the API gets updated and I have not added the fields into Pushraven. You cant just make up attributes (i.e. extraField) because the API would not know how to interpret that data which is why you got the error.
Also, I am not sure what you are trying to do in your code but it is possible what you are looking for is:
Notification not = (Notification) new Notification()
.title(applicationName)
.body(notificationBody)
.data(map);
yup, thats the one i am looking for, the extra payload, thanks =D Man, I really love this API, i been checking around, some write their own code to do it, but still i find this API is simple and easy to use. So are you gonna maintain it actively?
Thanks.
I will try to keep it updated with the API. There are a few improvements that should be done behind the scenes but I have been busy with other things lately. If you find any bugs or come up with improvements just write an issue and I'll have a look.
Hi there,
can I know how to use .addAttributeMap(key, map)?
//my code Map<String,String> map=new HashMap<String,String>();
map.put("name","Amit");
map.put("abc","Vijay");
map.put("haha","Rahul");
I got this error: Error Message: '{ "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name \"extra_field\" at 'message.notification'