Send Pushwoosh notification from Web app

Send Pushwoosh notification from Web app

  

I am successfully sending and receiving Pushwoosh notifications in a mobile application.  

However, I also have a need, in a Web application, to send a Pushwoosh notification to mobile devices.  I am not able to get that working.  I created a very simple Web screen and a server action to test it, but I can't get it working and I don't know what I am doing wrong.  Here is a screenshot; can anyone tell me what I am doing wrong?  Thank you.  -- Joel

Hello Joel,

Did you debug to see if your local variables have values when calling SendPushNotificationToDecive action?

Did you get any error?

If your message is inside the InputForm, you are clearing all the values before sending the Notification. Put the ajax refresh after the SendPushNotification action.


Thank you for your rapid response.  I followed your suggestion and moved the ajax refresh.  I also found that "Register Token" is failing.  I think it may be due to the value of the hardware id.  Can you advise on how I should obtain that in OutSystems for a Web application?  Thanks again.

  -- Joel

Hello,

To get the device Id you need to run the client action GetDeviceID on the device. This action is on the pushwoosh plugin.

Hello Joel,


If you're considering to receive push notification on the web also, take a look at this component.


If you just want to send push notifications to mobile devices registered with the PushwooshPlugin, then you just need to invoke the SendPushNotificationToUserId server action from the PushwooshPlugin module - with the correct parameters, of course.


The register token is part of the device registration process and doesn't seem to be required for what you're trying to achieve.


Cheers,

Armando

EFreitas, in Manage Dependencies, I see that GetDeviceID is a client action that I am not able to include in this Web app.  Per Armando's message, it looks like to send Pushwoosh notifications from a Web app I don't need to register the device so I can take out that server action.


Armando, thank you for the info.  Our need at this time isn't to be able to receive notifications into our Web app, but we will need that in the future.  I'll take a look at the component you recommend.


EFreitas and Armando, I still am not able to get this to work.  I've stripped out everything I can in this Web test app, and it isn't sending the push notification to the device.  

Below are screenshots of the Web app's screen showing a partial view of the values of the variables, and also the SendPushNotificationToDevice action.  Can you see anything that I am doing wrong?  Thank you again!

  -- Joel





Hello Joel,


Please find attached an OML working. I've used my own Pushwoosh credentials.


Let me know if this helps,

Armando


PS: Make sure the API credential has the required privileges to do the data manipulation...


Hello Joel,

You can find more information here:
https://success.outsystems.com/Documentation/Development_FAQs/How_to_Use_Push_Notifications_with_Pushwoosh

Try to follow the example on the link, by adding the logic to the login action (on the device), login 2 or 3 times with one user to be sure that your device was registered and than try to send a push notification to the user that you logged in through SendPushNotificationToUserId action and see if you receive a notification.
Remember to close the app before start testing.

"If your app is running, the notification doesn't show on the device. Instead, it is sent to the app and the event NotificationReceivedEvent is raised. You'll need to define what you want the app to do in that situation."

Gentlemen, thank you!  I had go be away from this for a few days, but I'm now using the helpful information you sent.  

I'm still having a problem sending to a specific device from a Web app.  However, the example Armando sent, which sends to a user rather than a device, will enable us to continue with our development for now.  I tried it with our API token and application code, and it is working well.  So I can replicate that in our app and use that until some future time when I can have someone figure out why our send to device id isn't working.

Again, thank you for your kind assistance!

  -- Joel

Hello Joel,


On the Pushwoosh Control Panel, you can activate the Debug Mode and then send a notification to that specific device. You'll then have access to a set of reports which may indicate the reason why that device is not receiving.


Cheers!

Thank you, Armando.  I'll check the Control Panel and Debug Mode.

  -- Joel