If a module wants to send a message preloaded with some additional element in $payload it would be nice not to need to reimplement push_notifications_send_message() just for that message.

Let's allow the $message parameter for push_notifications_send_message() be an array. If it is then look for the 'alert' key and use that as $message.

Comments

jacob.embree created an issue. See original summary.

jacob.embree’s picture

jacob.embree’s picture

StatusFileSize
new1.66 KB

Wrong path the first time. This is the right one.

vimalgoradiya’s picture

StatusFileSize
new1.15 KB

I tried with patch #3 which still improve in condition to allow array.

This will allow you to send array in action of rules bu custom php code selection which is something like this.

$uids = array('1');
$message = array('alert'=>'Enter your message', 'badge'=>1, 'sound'=>'default');
print push_notifications_send_message($uids,$message);