I'm trying to set as a simple message to the contents field in onesignal request body. And I'm getting an error message "contents must be key/value collections by language code".
ObjectNode jsonMessage = Json.newObject();
jsonMessage.put("contents", "{\"en\": \"English Message\"");
Push Response******** {"errors":["contents must be key/value collections by language code"]}
Make sure you format the JSON string correctly, e.g:
{"en": "English Message", "es": "Spanish Message"}
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With