pushnotifications.send_notification
The parameters that you need to send to the event as as follows:
userId - The user Id of the person to send the notification to
content - The actual message content
Here is a working example:
$notification = new OW_Event('pushnotifications.send_notification', array(
'userId'=> 300,
'content'=> 'This is a message')
);
OW::getEventManager()->trigger($notification);
---------------------------------------------------------
If you do not want to use the built in OneSignal red bell to allow users to subscribe and unsubscribe from push notifications you can use our built in checkbox. To place the component for subscribing and unsubscribing you can use these two methods:
Method 1 in the controller/component php file:
$this->addComponent('subscribeButton', new OFCOUTNER_CMP_SubscribeButton);
Method 2 in the SMARTY template file
{component class='OFCOUNTER_CMP_SubscribeButton'}