SeVeNDuS / node-onesignal-api

OneSignal's unofficial node.js client library for using OneSignal Rest API.
MIT License
50 stars 11 forks source link

Fixed wrongfull error message #5

Closed Froelund closed 8 years ago

Froelund commented 8 years ago

Include ability to create notification with template_id.

SeVeNDuS commented 8 years ago

Hi Froelund,

First of all sorry for my late reply. I have double checked OneSignal Documentation and template_id is not required so cannot be require in the nodejs api client

Other possibility is to add a extra parameter with a custom validator

Regards

Froelund commented 8 years ago

As I read the documentation, either template_id or contents is required.

SeVeNDuS commented 8 years ago

Please, send me the information when you have seen that template_id is required due to in the official link https://documentation.onesignal.com/docs/notifications-create-notification it appears optional

Regards

SeVeNDuS commented 8 years ago

I have double read the documentation and the logic is the following:

contents is required unless content_available, _background_data or template_id (one of them) are set.

So template_id not is required but the logic must be changed to validate those parameters

SeVeNDuS commented 8 years ago

Now contents is only required if template_ir or content_availabe are not present into params objtect