Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: How to send custom data parameter? #64

Closed
mike927 opened this issue Jul 26, 2023 · 1 comment
Closed

[question]: How to send custom data parameter? #64

mike927 opened this issue Jul 26, 2023 · 1 comment

Comments

@mike927
Copy link

mike927 commented Jul 26, 2023

No description provided.

@mike927 mike927 closed this as completed Jul 27, 2023
@kpturner
Copy link

kpturner commented Sep 1, 2023

I do it like this:

export async function sendPushNotification(
  templateId: string,
  destinationId: string,
  data?: object,
) {
  const notification: OneSignal.Notification = {
    app_id: appId,
    template_id: templateId,
    custom_data: data,
    include_external_user_ids: [destinationId],
    // include_aliases: { onesignal_id: [destinationId] },
  }
  await client.createNotification(notification)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants