iam.Carrot
iam.Carrot

Reputation: 5286

App launched due to push notification tap

Hello I am working on a windows phone 8.1 (RT) application and I am receiving push notifications on the app. What I want to do is, check if the user tapped on the push notification to launch the app. Because in my case suppose the push notification says "new story about Batman", now when the user taps on the push notification I need my app to navigate to the storyPage.xaml and update the view about the new story about Batman. I tried to search online but I couldn't find anything useful and I know it's possible because we all use whatsapp. when we tap on the notification about the message, that particular chat opens. I found This Link but I don't know where to put this code. How can I achieve this? I need help Thanks.

Upvotes: 0

Views: 259

Answers (1)

Kishor Bikram Oli
Kishor Bikram Oli

Reputation: 1828

While sending push notification, you toast xml should have launch parameters.

When the user taps or clicks the notification, the associated app is automatically launched, and so its OnLaunched method is invoked. If we want to determine whether the app is activated by a toast notification click, we can use the Arguments property of the LaunchActivatedEventArgs object that is passed to this method.

Please have a look on this blog: https://marcominerva.wordpress.com/2013/03/25/how-to-pass-arguments-to-an-app-activated-by-a-toast-notification/

Upvotes: 1

Related Questions