Reputation: 13
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
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