Page 1 of 1

[ProcessMaker App] - Badge & Push Notification Problem

Posted: Mon Feb 11, 2019 12:47 am
by sengroty
Hi Guys,

Having two questions as follows:
1. Is there any possible way to push notification via a ProcessMaker mobile app both iOS and Android?
2. Does the badge automatically visible once the request came in (run in the background)? From my experiences, the badge won't be visible until we go to the app and the app sync the data from the server.

Many Thanks

Re: [ProcessMaker App] - Badge & Push Notification Problem

Posted: Tue Feb 12, 2019 12:33 am
by amosbatto
sengroty wrote:1. Is there any possible way to push notification via a ProcessMaker mobile app both iOS and Android?
Do you want to send a custom notification?
You can try this code in a trigger:
Code: Select all
$oND = new \ProcessMaker\BusinessModel\Light\NotificationDevice();
//an array of user IDs to receive message:
$aUsers = array('XXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXX');
$message="This is a test of the emergency broadcast system" ;
$oND->sendMessage($aUsers, $message);
Also you can see the NOTIFICATION_QUEUE table in the database.
sengroty wrote:2. Does the badge automatically visible once the request came in (run in the background)? From my experiences, the badge won't be visible until we go to the app and the app sync the data from the server.
Did you set the sendnotificationscron.php script to periodically execute on your ProcessMaker server?
I think that should fix your problem.

Re: [ProcessMaker App] - Badge & Push Notification Problem

Posted: Thu Feb 14, 2019 10:55 pm
by sengroty
Having tried following your comments. However, still having some issue as follows:
1. The push pop-up message is visible only when we open the app. Hence, if the app in close, then only vibration. And once click open, produce an error as shown in the attached.
2. I tried to manual execute the cron.php and sendnotificationscron.php, but it's produced some error as shown in the attached.

Re: [ProcessMaker App] - Badge & Push Notification Problem

Posted: Fri Feb 15, 2019 9:40 pm
by amosbatto
There is a third parameter in the sendMessage() function which is an array where you can include the cas_index, but I don't have time to look through the code to figure out how to find it. Actually, there is no reason for the users to open the message, since they can already see the message.

If you want to investigate, look in the workflow/engine/src/ProcessMaker/BusinessModel/Light/NotificationDevice.php file at the sendMessage() function. From there you will have to search through the source code to figure out what is passed to sendMessage().

For your problem executing sendnotificationcron.php, what is your version of PM and what version of Windows? Is this a bitnami or manual install?

Can you list the exact commands that you used in the terminal to execute the file?