Ben
Ben

Reputation: 1434

Windows 8.1 : Create "silent" toast notification

I'm working on a Windows app and integrated Toast notification in it. Paired with an AWS SNS service, it's working fine, I can successfully receive my notifications.

My notifications are used to fire events when the app is launched, it's not designed for final user. For this reason, I don't need any banner or display for these notifications: only handle the event in the app.

My issue is, when the app is killed, Windows displays a banner (top right corner) for any new notification. I found a way to disable banners directly in the OS, but I would like a solution when pushing the notification (backend side).

I already did it for iOS, kind of 'silent' notification, without any alert, sound or badge, but can still be handled by the OS.

I would like to know if there is any way to do that on Windows too? Like any extra arguments I missed or a dedicated template for that.

Thanks

Upvotes: 0

Views: 284

Answers (1)

Ben
Ben

Reputation: 1434

I finally found a way to do that.

I changed from Toast notification to Raw notification (a push notification that does not involve UI). (MSDN - Documentation)

After that, I had to customise my AWS SNS notification wiht MessageAttributes to change the type of my WNS notification (AWS - Documentation).

I've also noticed that we can directly suppress the Toast UI on Windows phone with "X-WNS-SuppressPopup" param, which can be also very helpful. (MSDN - SuppressPopup).

Finally, inspired from AWS Baidu Push notification sample code, I did the same for WNS platform, adding all new arguments I needed, and it works great at the end.

Hope this can help someone else.

Upvotes: 1

Related Questions