[OneSignal Plugin]  Can we use OneSignal Categories?

Forge Component
(13)
Published on 2019-10-18 by OutSystems R&D
13 votes
Published on 2019-10-18 by OutSystems R&D

OneSignal supports different categories for notifications that behave differently when they are received but there appears to be no way to assign a notification to a specific category with the SendPushNotificationToUserID action. Is this not supported by this plugin or am I just missing something?

You are missing something

Did you do somethin like this:

Yes, I have done all that and I can send the notification just fine, but I can't assign the notification to a category I create in the OneSignal dashboard.

Solution

Zachary wrote:

OneSignal supports different categories for notifications that behave differently when they are received but there appears to be no way to assign a notification to a specific category with the SendPushNotificationToUserID action. Is this not supported by this plugin or am I just missing something?

It is documented in this api that the request to the create notification api(https://documentation.onesignal.com/reference#create-notification search for android_channel_id) should pass the parameter for it, but looking at the plugin isnt there.

What I would try to do is add that parameter on the PostNotificationRequest structure in the OneSignalAPI module. (it's the last one, android_channel_id)

 Then on the "onBeforeRequest" action on the Onesignal rest apis, copy Transform Contents and create the node Trasnform categeries like shown in the next image : 


And then add a new parameter in the SendPushNotificationToUserId which will receive that value. 

Then in the "PostNotification" action you will need to add an input parameter as well to map that new parameter to the structure that is passed to make the Rest API Call.



Solution

I didn't need the transform contents but the rest of that worked perfectly, thanks!