johnjamesmcgowan.jjmg
johnjamesmcgowan.jjmg

Reputation: 13

Prevent UWP app opening when notification is clicked

I am building a UWP app which receives notifications via a notification hub on Azure. My code is essentially like this tutorial here, which is working perfectly. I just need to stop the UWP app opening whenever a user clicks the notification, essentially doing nothing instead. How can I do this, I can not find a direct answer online that works for me?

Upvotes: 1

Views: 227

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

Prevent UWP app opening when notification is clicked

When you click toast, it will launch the app by default. But, we could specific action button and set the ToastActivationType as Background or set toast activationType="background" directly. When you click the button, it will launch the background but not the app. For more please refer handling-background-activation

Upvotes: 1

Related Questions