Skip to content

[Bug]: Adding target_channel to the Notification class #147

@ricardoribas

Description

@ricardoribas

What happened?

It seems there is an issue with the @onesignal/[email protected] in which, if I create a notification class object:

const notification = new Notification();

notification.target_channel = 'email';

client.createNotification(notification);

The target_channel is undefined. I started to have this issue when I was integrating the email target channel.

HOWEVER, if I create the notification with:

client.createNotification({
    ...notification,
    target_channel: 'email
});

It does work. I tried also with the alpha version and the problem is the same.

Steps to reproduce?

1. Install @onesignal/node-onesignal@5.3.1-beta1
2. Add the following snippet:


const notification = new Notification();

...include subscription_ids or aliases

notification.target_channel = 'email';

client.createNotification(notification);

What did you expect to happen?

Expect to send emails and not push notifications

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions