67
Views
2
Comments
[OneSignal Notification Plugin] Ideas for OneSignal Plugin: SendTag, PostNotificationToUser, PostNotificationToTag
Question
onesignal-plugin
Mobile icon
Forge asset by Alexandre Costa

Hi, I have been customizing this OneSignal Plugin for my purposes, but I figured this may also help other users if implemented officially.


On OneSignalPlugin:

1. add new public Client-side Logic named "SendTag" with JS:

window.plugins.OneSignal.sendTag($parameters.key, $parameters.value);


2. on RegisterDevice logic, add new JS after RegisterDevice JS:

window.plugins.OneSignal.sendTag("userid", $parameters.UserId);


On OneSignalApi:

1. add new public Server-side Logic named "PostNotificationToUser", which send notification based on "userid" tag.


2. add new public Server-side Logic named "PostNotificationToTag", which send notification based on specific key-value tag.


Currently I have problem attaching picture, I will attach some picture as soon as I can.

2025-10-21 13-42-45
Alexandre Costa

Hello Harlin thanks for your contribution. I will insert your code. Outystems will launch a official OneSignal plugin soon. So my plugin will be renamed but is still avaiable and can be customized.


Harlin Setiadarma wrote:

Hi, I have been customizing this OneSignal Plugin for my purposes, but I figured this may also help other users if implemented officially.


On OneSignalPlugin:

1. add new public Client-side Logic named "SendTag" with JS:

window.plugins.OneSignal.sendTag($parameters.key, $parameters.value);


2. on RegisterDevice logic, add new JS after RegisterDevice JS:

window.plugins.OneSignal.sendTag("userid", $parameters.UserId);


On OneSignalApi:

1. add new public Server-side Logic named "PostNotificationToUser", which send notification based on "userid" tag.


2. add new public Server-side Logic named "PostNotificationToTag", which send notification based on specific key-value tag.


Currently I have problem attaching picture, I will attach some picture as soon as I can.



2024-03-25 06-19-08
Harlin Setiadarma

That's great news, I hope it will have SUPPORTED status.

Anyway, I've attached my own modification of your OneSignal Plugin, I hope it can help someone...

Harlin OneSignal Plugin.oap
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.