16
Views
1
Comments
Solved
Push NotificationActions - OneSignal
Application Type
Mobile

Hello all,

I'm facing some challenges in implementing the Push Notification Actions in OneSignal. I've implemented till the button creation, but I got no idea for mapping with certain action. 


Clear & Open Link are the two action buttons, I'm talking about. I've no idea in implementing specific actions for those buttons. Kindly help me with this. 

Thanks,
Nandhakumar S.

Solution

Hello People,

I got disappointed that, nobody showed up to answer my query.
Anyhow, I've achieved the expectation, which I was posted earlier. 

Here, I'm sharing the solution, that how I've achieved my expectation.

Button Creation: -

In the "SendPushNotifiation" Server action, you can see the parameter called notification actions. By expanding that you can see ID, Text, Icon will be asked. By passing the Text and ID you can create a Button.

Assigning actions to the buttons: -

Add the "OneSignal" Block in the Layout block. Once the block is added, it requires the handlers for "On Notification Opened" and "On Notification Received". By using these actions, we can assign our required action.

 In my scenario, I need to perform some actions when the button is clicked. So, In the "Notification Open" handler I placed a condition to check id of the respective button.


Hope this solution will help others.

Regards,
Nandhakumar S.


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